Use host MariaDB in Gitea container
This commit is contained in:
3
roles/mariadb/defaults/main.yml
Normal file
3
roles/mariadb/defaults/main.yml
Normal file
@@ -0,0 +1,3 @@
|
||||
mariadb_trust:
|
||||
- "172.16.0.0/12"
|
||||
- "192.168.0.0/16"
|
25
roles/mariadb/tasks/main.yml
Normal file
25
roles/mariadb/tasks/main.yml
Normal file
@@ -0,0 +1,25 @@
|
||||
- name: Install MariaDB
|
||||
apt:
|
||||
name: mariadb-server
|
||||
state: present
|
||||
|
||||
- name: Change the bind-address to allow Docker
|
||||
lineinfile:
|
||||
path: /etc/mysql/mariadb.conf.d/50-server.cnf
|
||||
regex: "^bind-address"
|
||||
line: "bind-address = 0.0.0.0"
|
||||
register: mariadb_conf
|
||||
|
||||
- name: Restart MariaDB
|
||||
service:
|
||||
name: mariadb
|
||||
state: restarted
|
||||
when: mariadb_conf.changed
|
||||
|
||||
- name: Allow database connections
|
||||
ufw:
|
||||
rule: allow
|
||||
port: "3306"
|
||||
proto: tcp
|
||||
src: "{{ item }}"
|
||||
loop: "{{ mariadb_trust }}"
|
Reference in New Issue
Block a user