Compare commits
3 Commits
d05c5d3086
...
5b09029239
Author | SHA1 | Date | |
---|---|---|---|
5b09029239 | |||
7adb5f10e9 | |||
c3b4321667 |
10
dev/gitea.yml
Normal file
10
dev/gitea.yml
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
- name: Install Gitea Server
|
||||||
|
hosts: all
|
||||||
|
become: true
|
||||||
|
vars_files:
|
||||||
|
- host_vars/gitea.yml
|
||||||
|
roles:
|
||||||
|
- base
|
||||||
|
- docker
|
||||||
|
- mariadb
|
||||||
|
- gitea
|
45
dev/host_vars/gitea.yml
Normal file
45
dev/host_vars/gitea.yml
Normal file
@ -0,0 +1,45 @@
|
|||||||
|
# base
|
||||||
|
allow_reboot: false
|
||||||
|
manage_network: false
|
||||||
|
|
||||||
|
users:
|
||||||
|
git:
|
||||||
|
uid: 1001
|
||||||
|
gid: 1001
|
||||||
|
home: true
|
||||||
|
|
||||||
|
# Import my GPG key for git signature verification
|
||||||
|
root_gpgkeys:
|
||||||
|
- name: kris@lamoureux.io
|
||||||
|
id: FBF673CEEC030F8AECA814E73EDA9C3441EDA925
|
||||||
|
|
||||||
|
# docker
|
||||||
|
docker_users:
|
||||||
|
- vagrant
|
||||||
|
|
||||||
|
docker_compose_env_nolog: false # dev only setting
|
||||||
|
docker_compose_deploy:
|
||||||
|
# Traefik
|
||||||
|
- name: traefik
|
||||||
|
url: https://github.com/krislamo/traefik
|
||||||
|
version: 398eb48d311db78b86abf783f903af4a1658d773
|
||||||
|
enabled: true
|
||||||
|
accept_newhostkey: true
|
||||||
|
trusted_keys:
|
||||||
|
- FBF673CEEC030F8AECA814E73EDA9C3441EDA925
|
||||||
|
env:
|
||||||
|
ENABLE: true
|
||||||
|
# Gitea
|
||||||
|
- name: gitea
|
||||||
|
url: https://github.com/krislamo/gitea
|
||||||
|
version: b0ce66f6a1ab074172eed79eeeb36d7e9011ef8f
|
||||||
|
env:
|
||||||
|
USER_UID: "{{ users.git.uid }}"
|
||||||
|
USER_GID: "{{ users.git.gid }}"
|
||||||
|
DB_PASSWD: "{{ gitea.DB_PASSWD }}"
|
||||||
|
|
||||||
|
# gitea
|
||||||
|
gitea:
|
||||||
|
DB_NAME: gitea
|
||||||
|
DB_USER: gitea
|
||||||
|
DB_PASSWD: password
|
@ -5,7 +5,12 @@ allow_reboot: false
|
|||||||
manage_network: false
|
manage_network: false
|
||||||
|
|
||||||
users:
|
users:
|
||||||
- name: jellyfin
|
jellyfin:
|
||||||
|
uid: 1001
|
||||||
|
gid: 1001
|
||||||
|
shell: /usr/sbin/nologin
|
||||||
|
home: false
|
||||||
|
system: true
|
||||||
|
|
||||||
samba:
|
samba:
|
||||||
users:
|
users:
|
||||||
|
@ -23,9 +23,10 @@ function ssh_connect {
|
|||||||
[yY])
|
[yY])
|
||||||
printf "[INFO]: Starting new vagrant SSH tunnel on PID "
|
printf "[INFO]: Starting new vagrant SSH tunnel on PID "
|
||||||
sudo -u "$USER" ssh -fNT -i "$PRIVATE_KEY" \
|
sudo -u "$USER" ssh -fNT -i "$PRIVATE_KEY" \
|
||||||
-L 8443:localhost:8443 \
|
-L 22:localhost:22 \
|
||||||
-L 80:localhost:80 \
|
-L 80:localhost:80 \
|
||||||
-L 443:localhost:443 \
|
-L 443:localhost:443 \
|
||||||
|
-L 8443:localhost:8443 \
|
||||||
-o UserKnownHostsFile=/dev/null \
|
-o UserKnownHostsFile=/dev/null \
|
||||||
-o StrictHostKeyChecking=no \
|
-o StrictHostKeyChecking=no \
|
||||||
vagrant@"$HOST_IP" 2>/dev/null
|
vagrant@"$HOST_IP" 2>/dev/null
|
||||||
|
@ -5,6 +5,10 @@
|
|||||||
listen: reboot_host
|
listen: reboot_host
|
||||||
when: allow_reboot
|
when: allow_reboot
|
||||||
|
|
||||||
|
- name: Reconfigure locales
|
||||||
|
ansible.builtin.command: dpkg-reconfigure -f noninteractive locales
|
||||||
|
listen: reconfigure_locales
|
||||||
|
|
||||||
- name: Restart WireGuard
|
- name: Restart WireGuard
|
||||||
ansible.builtin.service:
|
ansible.builtin.service:
|
||||||
name: wg-quick@wg0
|
name: wg-quick@wg0
|
||||||
|
@ -2,4 +2,4 @@
|
|||||||
ansible.builtin.file:
|
ansible.builtin.file:
|
||||||
path: "~/.ansible/tmp"
|
path: "~/.ansible/tmp"
|
||||||
state: directory
|
state: directory
|
||||||
mode: 0700
|
mode: "700"
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
ansible.builtin.template:
|
ansible.builtin.template:
|
||||||
src: ddclient.conf.j2
|
src: ddclient.conf.j2
|
||||||
dest: /etc/ddclient.conf
|
dest: /etc/ddclient.conf
|
||||||
mode: 0600
|
mode: "600"
|
||||||
register: ddclient_settings
|
register: ddclient_settings
|
||||||
|
|
||||||
- name: Start ddclient and enable on boot
|
- name: Start ddclient and enable on boot
|
||||||
|
@ -32,14 +32,14 @@
|
|||||||
ansible.builtin.template:
|
ansible.builtin.template:
|
||||||
src: fail2ban-ssh.conf.j2
|
src: fail2ban-ssh.conf.j2
|
||||||
dest: /etc/fail2ban/jail.d/sshd.conf
|
dest: /etc/fail2ban/jail.d/sshd.conf
|
||||||
mode: 0640
|
mode: "640"
|
||||||
notify: restart_fail2ban
|
notify: restart_fail2ban
|
||||||
|
|
||||||
- name: Install Fail2ban IP allow list
|
- name: Install Fail2ban IP allow list
|
||||||
ansible.builtin.template:
|
ansible.builtin.template:
|
||||||
src: fail2ban-allowlist.conf.j2
|
src: fail2ban-allowlist.conf.j2
|
||||||
dest: /etc/fail2ban/jail.d/allowlist.conf
|
dest: /etc/fail2ban/jail.d/allowlist.conf
|
||||||
mode: 0640
|
mode: "640"
|
||||||
when: fail2ban_ignoreip is defined
|
when: fail2ban_ignoreip is defined
|
||||||
notify: restart_fail2ban
|
notify: restart_fail2ban
|
||||||
|
|
||||||
|
@ -11,10 +11,10 @@
|
|||||||
ansible.builtin.template:
|
ansible.builtin.template:
|
||||||
src: msmtprc.j2
|
src: msmtprc.j2
|
||||||
dest: /root/.msmtprc
|
dest: /root/.msmtprc
|
||||||
mode: 0600
|
mode: "600"
|
||||||
|
|
||||||
- name: Install /etc/aliases
|
- name: Install /etc/aliases
|
||||||
ansible.builtin.copy:
|
ansible.builtin.copy:
|
||||||
dest: /etc/aliases
|
dest: /etc/aliases
|
||||||
content: "root: {{ mail.rootalias }}"
|
content: "root: {{ mail.rootalias }}"
|
||||||
mode: 0644
|
mode: "644"
|
||||||
|
@ -10,6 +10,6 @@
|
|||||||
ansible.builtin.template:
|
ansible.builtin.template:
|
||||||
src: "interface.j2"
|
src: "interface.j2"
|
||||||
dest: "/etc/network/interfaces.d/{{ item.name }}"
|
dest: "/etc/network/interfaces.d/{{ item.name }}"
|
||||||
mode: 0400
|
mode: "400"
|
||||||
loop: "{{ interfaces }}"
|
loop: "{{ interfaces }}"
|
||||||
notify: reboot_host
|
notify: reboot_host
|
||||||
|
@ -3,23 +3,15 @@
|
|||||||
name: samba
|
name: samba
|
||||||
state: present
|
state: present
|
||||||
|
|
||||||
- name: Create nologin shell accounts for Samba
|
|
||||||
ansible.builtin.user:
|
|
||||||
name: "{{ item.name }}"
|
|
||||||
state: present
|
|
||||||
shell: /usr/sbin/nologin
|
|
||||||
createhome: false
|
|
||||||
system: yes
|
|
||||||
loop: "{{ samba.users }}"
|
|
||||||
when: item.manage_user is defined and item.manage_user is true
|
|
||||||
|
|
||||||
- name: Create Samba users
|
- name: Create Samba users
|
||||||
ansible.builtin.shell: "smbpasswd -a {{ item.name }}"
|
ansible.builtin.command: "smbpasswd -a {{ item.name }}"
|
||||||
args:
|
args:
|
||||||
stdin: "{{ item.password }}\n{{ item.password }}"
|
stdin: "{{ item.password }}\n{{ item.password }}"
|
||||||
loop: "{{ samba.users }}"
|
loop: "{{ samba.users }}"
|
||||||
|
loop_control:
|
||||||
|
label: "{{ item.name }}"
|
||||||
register: samba_users
|
register: samba_users
|
||||||
changed_when: "'User added' in samba_users.stdout"
|
changed_when: "'Added user' in samba_users.stdout"
|
||||||
|
|
||||||
- name: Ensure share directories exist
|
- name: Ensure share directories exist
|
||||||
ansible.builtin.file:
|
ansible.builtin.file:
|
||||||
@ -27,13 +19,14 @@
|
|||||||
owner: "{{ item.owner }}"
|
owner: "{{ item.owner }}"
|
||||||
group: "{{ item.group }}"
|
group: "{{ item.group }}"
|
||||||
state: directory
|
state: directory
|
||||||
mode: 0755
|
mode: "755"
|
||||||
loop: "{{ samba.shares }}"
|
loop: "{{ samba.shares }}"
|
||||||
|
|
||||||
- name: Configure Samba shares
|
- name: Configure Samba shares
|
||||||
ansible.builtin.template:
|
ansible.builtin.template:
|
||||||
src: smb.conf.j2
|
src: smb.conf.j2
|
||||||
dest: /etc/samba/smb.conf
|
dest: /etc/samba/smb.conf
|
||||||
|
mode: "700"
|
||||||
notify: restart_samba
|
notify: restart_samba
|
||||||
|
|
||||||
- name: Start smbd and enable on boot
|
- name: Start smbd and enable on boot
|
||||||
|
@ -10,7 +10,7 @@
|
|||||||
state: present
|
state: present
|
||||||
|
|
||||||
- name: Check for existing GPG keys
|
- name: Check for existing GPG keys
|
||||||
command: "gpg --list-keys {{ item.id }} 2>/dev/null"
|
ansible.builtin.command: "gpg --list-keys {{ item.id }} 2>/dev/null"
|
||||||
register: gpg_check
|
register: gpg_check
|
||||||
loop: "{{ root_gpgkeys }}"
|
loop: "{{ root_gpgkeys }}"
|
||||||
failed_when: false
|
failed_when: false
|
||||||
@ -18,20 +18,22 @@
|
|||||||
when: root_gpgkeys is defined
|
when: root_gpgkeys is defined
|
||||||
|
|
||||||
- name: Import GPG keys
|
- name: Import GPG keys
|
||||||
command: "gpg --keyserver {{ item.item.server | default('keys.openpgp.org') }} --recv-key {{ item.item.id }}"
|
ansible.builtin.command:
|
||||||
|
"gpg --keyserver {{ item.item.server | default('keys.openpgp.org') }} --recv-key {{ item.item.id }}"
|
||||||
register: gpg_check_import
|
register: gpg_check_import
|
||||||
loop: "{{ gpg_check.results }}"
|
loop: "{{ gpg_check.results }}"
|
||||||
loop_control:
|
loop_control:
|
||||||
label: "{{ item.item }}"
|
label: "{{ item.item }}"
|
||||||
|
changed_when: false
|
||||||
when: root_gpgkeys is defined and item.rc != 0
|
when: root_gpgkeys is defined and item.rc != 0
|
||||||
|
|
||||||
- name: Check GPG key imports
|
- name: Check GPG key imports
|
||||||
fail:
|
ansible.builtin.fail:
|
||||||
msg: "{{ item.stderr }}"
|
msg: "{{ item.stderr }}"
|
||||||
loop: "{{ gpg_check_import.results }}"
|
loop: "{{ gpg_check_import.results }}"
|
||||||
loop_control:
|
loop_control:
|
||||||
label: "{{ item.item.item }}"
|
label: "{{ item.item.item }}"
|
||||||
when: (item.skipped | default(false) == false) and ('imported' not in item.stderr)
|
when: root_gpgkeys is defined and (not item.skipped | default(false)) and ('imported' not in item.stderr)
|
||||||
|
|
||||||
- name: Install NTPsec
|
- name: Install NTPsec
|
||||||
ansible.builtin.apt:
|
ansible.builtin.apt:
|
||||||
@ -47,7 +49,7 @@
|
|||||||
community.general.locale_gen:
|
community.general.locale_gen:
|
||||||
name: "{{ locale_default }}"
|
name: "{{ locale_default }}"
|
||||||
state: present
|
state: present
|
||||||
register: locale_gen_output
|
notify: reconfigure_locales
|
||||||
|
|
||||||
- name: Set the default locale
|
- name: Set the default locale
|
||||||
ansible.builtin.lineinfile:
|
ansible.builtin.lineinfile:
|
||||||
@ -55,24 +57,35 @@
|
|||||||
regexp: "^LANG="
|
regexp: "^LANG="
|
||||||
line: "LANG={{ locale_default }}"
|
line: "LANG={{ locale_default }}"
|
||||||
|
|
||||||
- name: Reconfigure locales
|
|
||||||
ansible.builtin.command: dpkg-reconfigure -f noninteractive locales
|
|
||||||
when: locale_gen_output.changed
|
|
||||||
|
|
||||||
- name: Manage root authorized_keys
|
- name: Manage root authorized_keys
|
||||||
ansible.builtin.template:
|
ansible.builtin.template:
|
||||||
src: authorized_keys.j2
|
src: authorized_keys.j2
|
||||||
dest: /root/.ssh/authorized_keys
|
dest: /root/.ssh/authorized_keys
|
||||||
mode: 0400
|
mode: "400"
|
||||||
when: authorized_keys is defined
|
when: authorized_keys is defined
|
||||||
|
|
||||||
|
- name: Create system user groups
|
||||||
|
ansible.builtin.group:
|
||||||
|
name: "{{ item.key }}"
|
||||||
|
gid: "{{ item.value.gid }}"
|
||||||
|
state: present
|
||||||
|
loop: "{{ users | dict2items }}"
|
||||||
|
loop_control:
|
||||||
|
label: "{{ item.key }}"
|
||||||
|
when: users is defined
|
||||||
|
|
||||||
- name: Create system users
|
- name: Create system users
|
||||||
ansible.builtin.user:
|
ansible.builtin.user:
|
||||||
name: "{{ item.name }}"
|
name: "{{ item.key }}"
|
||||||
state: present
|
state: present
|
||||||
shell: "{{ item.shell | default('/bin/bash') }}"
|
uid: "{{ item.value.uid }}"
|
||||||
create_home: "{{ item.home | default(false) }}"
|
group: "{{ item.value.gid }}"
|
||||||
loop: "{{ users }}"
|
shell: "{{ item.value.shell | default('/bin/bash') }}"
|
||||||
|
create_home: "{{ item.value.home | default(false) }}"
|
||||||
|
system: "{{ item.value.system | default(false) }}"
|
||||||
|
loop: "{{ users | dict2items }}"
|
||||||
|
loop_control:
|
||||||
|
label: "{{ item.key }}"
|
||||||
when: users is defined
|
when: users is defined
|
||||||
|
|
||||||
- name: Set authorized_keys for system users
|
- name: Set authorized_keys for system users
|
||||||
@ -80,7 +93,9 @@
|
|||||||
user: "{{ item.key }}"
|
user: "{{ item.key }}"
|
||||||
key: "{{ item.value.key }}"
|
key: "{{ item.value.key }}"
|
||||||
state: present
|
state: present
|
||||||
loop: "{{ users }}"
|
loop: "{{ users | dict2items }}"
|
||||||
|
loop_control:
|
||||||
|
label: "{{ item.key }}"
|
||||||
when: users is defined and item.value.key is defined
|
when: users is defined and item.value.key is defined
|
||||||
|
|
||||||
- name: Manage filesystem mounts
|
- name: Manage filesystem mounts
|
||||||
|
@ -22,7 +22,7 @@
|
|||||||
ansible.builtin.template:
|
ansible.builtin.template:
|
||||||
src: wireguard.j2
|
src: wireguard.j2
|
||||||
dest: /etc/wireguard/wg0.conf
|
dest: /etc/wireguard/wg0.conf
|
||||||
mode: 0400
|
mode: "400"
|
||||||
notify: restart_wireguard
|
notify: restart_wireguard
|
||||||
|
|
||||||
- name: Start WireGuard interface
|
- name: Start WireGuard interface
|
||||||
|
@ -48,7 +48,7 @@
|
|||||||
repo: "{{ item.url }}"
|
repo: "{{ item.url }}"
|
||||||
dest: "{{ docker_repos_path }}/{{ item.name }}"
|
dest: "{{ docker_repos_path }}/{{ item.name }}"
|
||||||
version: "{{ item.version }}"
|
version: "{{ item.version }}"
|
||||||
accept_newhostkey: "{{ item.accept_newhostkey | default('false') }}"
|
accept_newhostkey: "{{ item.accept_newhostkey | default(false) }}"
|
||||||
gpg_whitelist: "{{ item.trusted_keys | default([]) }}"
|
gpg_whitelist: "{{ item.trusted_keys | default([]) }}"
|
||||||
verify_commit: "{{ true if (item.trusted_keys is defined and item.trusted_keys) else false }}"
|
verify_commit: "{{ true if (item.trusted_keys is defined and item.trusted_keys) else false }}"
|
||||||
key_file: "{{ docker_repos_keys }}/id_{{ docker_repos_keytype }}"
|
key_file: "{{ docker_repos_keys }}/id_{{ docker_repos_keytype }}"
|
||||||
@ -86,7 +86,7 @@
|
|||||||
mode: 0400
|
mode: 0400
|
||||||
register: compose_env_update
|
register: compose_env_update
|
||||||
notify: compose_restart
|
notify: compose_restart
|
||||||
no_log: "{{ docker_compose_env_nolog | default('true') }}"
|
no_log: "{{ docker_compose_env_nolog | default(true) }}"
|
||||||
loop: "{{ docker_compose_deploy }}"
|
loop: "{{ docker_compose_deploy }}"
|
||||||
loop_control:
|
loop_control:
|
||||||
label: "{{ item.name }}"
|
label: "{{ item.name }}"
|
||||||
|
@ -1,38 +1,23 @@
|
|||||||
- name: Create Gitea directory
|
- name: Install MySQL module for Ansible
|
||||||
ansible.builtin.file:
|
ansible.builtin.apt:
|
||||||
path: "{{ gitea_root }}"
|
name: python3-pymysql
|
||||||
state: directory
|
state: present
|
||||||
|
|
||||||
- name: Create Gitea database
|
- name: Create Gitea database
|
||||||
community.mysql.mysql_db:
|
community.mysql.mysql_db:
|
||||||
name: "{{ gitea_dbname }}"
|
name: "{{ gitea.DB_NAME }}"
|
||||||
state: present
|
state: present
|
||||||
login_unix_socket: /var/run/mysqld/mysqld.sock
|
login_unix_socket: /var/run/mysqld/mysqld.sock
|
||||||
|
|
||||||
- name: Create Gitea database user
|
- name: Create Gitea database user
|
||||||
community.mysql.mysql_user:
|
community.mysql.mysql_user:
|
||||||
name: "{{ gitea_dbuser }}"
|
name: "{{ gitea.DB_USER }}"
|
||||||
password: "{{ gitea_dbpass }}"
|
password: "{{ gitea.DB_PASSWD }}"
|
||||||
host: '%'
|
host: '%'
|
||||||
state: present
|
state: present
|
||||||
priv: "{{ gitea_dbname }}.*:ALL"
|
priv: "{{ gitea.DB_NAME }}.*:ALL"
|
||||||
login_unix_socket: /var/run/mysqld/mysqld.sock
|
login_unix_socket: /var/run/mysqld/mysqld.sock
|
||||||
|
|
||||||
- name: Create git user
|
|
||||||
ansible.builtin.user:
|
|
||||||
name: git
|
|
||||||
state: present
|
|
||||||
|
|
||||||
- name: Git user uid
|
|
||||||
ansible.builtin.getent:
|
|
||||||
database: passwd
|
|
||||||
key: git
|
|
||||||
|
|
||||||
- name: Git user gid
|
|
||||||
ansible.builtin.getent:
|
|
||||||
database: group
|
|
||||||
key: git
|
|
||||||
|
|
||||||
- name: Create git's .ssh directory
|
- name: Create git's .ssh directory
|
||||||
ansible.builtin.file:
|
ansible.builtin.file:
|
||||||
path: /home/git/.ssh
|
path: /home/git/.ssh
|
||||||
@ -70,28 +55,11 @@
|
|||||||
dest: /usr/local/bin/gitea
|
dest: /usr/local/bin/gitea
|
||||||
mode: 0755
|
mode: 0755
|
||||||
|
|
||||||
- name: Install Gitea's docker-compose file
|
|
||||||
ansible.builtin.template:
|
|
||||||
src: docker-compose.yml.j2
|
|
||||||
dest: "{{ gitea_root }}/docker-compose.yml"
|
|
||||||
notify: restart_gitea
|
|
||||||
|
|
||||||
- name: Install Gitea's docker-compose variables
|
|
||||||
ansible.builtin.template:
|
|
||||||
src: compose-env.j2
|
|
||||||
dest: "{{ gitea_root }}/.env"
|
|
||||||
notify: restart_gitea
|
|
||||||
|
|
||||||
- name: Create Gitea's logging directory
|
- name: Create Gitea's logging directory
|
||||||
ansible.builtin.file:
|
ansible.builtin.file:
|
||||||
name: /var/log/gitea
|
name: /var/log/gitea
|
||||||
state: directory
|
state: directory
|
||||||
|
|
||||||
- name: Create Gitea's initial log file
|
|
||||||
ansible.builtin.file:
|
|
||||||
name: /var/log/gitea/gitea.log
|
|
||||||
state: touch
|
|
||||||
|
|
||||||
- name: Install Gitea's Fail2ban filter
|
- name: Install Gitea's Fail2ban filter
|
||||||
ansible.builtin.template:
|
ansible.builtin.template:
|
||||||
src: fail2ban-filter.conf.j2
|
src: fail2ban-filter.conf.j2
|
||||||
|
@ -1,3 +0,0 @@
|
|||||||
mariadb_trust:
|
|
||||||
- "172.16.0.0/12"
|
|
||||||
- "192.168.0.0/16"
|
|
5
roles/mariadb/handlers/main.yml
Normal file
5
roles/mariadb/handlers/main.yml
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
- name: Restart MariaDB
|
||||||
|
ansible.builtin.service:
|
||||||
|
name: mariadb
|
||||||
|
state: restarted
|
||||||
|
listen: restart_mariadb
|
@ -3,23 +3,20 @@
|
|||||||
name: mariadb-server
|
name: mariadb-server
|
||||||
state: present
|
state: present
|
||||||
|
|
||||||
- name: Change the bind-address to allow Docker
|
- name: Regather facts for the potentially new docker0 interface
|
||||||
|
ansible.builtin.setup:
|
||||||
|
|
||||||
|
- name: Change the bind-address to allow from docker0
|
||||||
ansible.builtin.lineinfile:
|
ansible.builtin.lineinfile:
|
||||||
path: /etc/mysql/mariadb.conf.d/50-server.cnf
|
path: /etc/mysql/mariadb.conf.d/50-server.cnf
|
||||||
regex: "^bind-address"
|
regex: "^bind-address"
|
||||||
line: "bind-address = 0.0.0.0"
|
line: "bind-address = {{ ansible_facts.docker0.ipv4.address }}"
|
||||||
register: mariadb_conf
|
notify: restart_mariadb
|
||||||
|
|
||||||
- name: Restart MariaDB
|
- name: Allow database connections from Docker
|
||||||
ansible.builtin.service:
|
|
||||||
name: mariadb
|
|
||||||
state: restarted
|
|
||||||
when: mariadb_conf.changed
|
|
||||||
|
|
||||||
- name: Allow database connections
|
|
||||||
community.general.ufw:
|
community.general.ufw:
|
||||||
rule: allow
|
rule: allow
|
||||||
port: "3306"
|
port: "3306"
|
||||||
proto: tcp
|
proto: tcp
|
||||||
src: "{{ item }}"
|
src: "{{ item }}"
|
||||||
loop: "{{ mariadb_trust }}"
|
loop: "{{ mariadb_trust | default(['172.16.0.0/12']) }}"
|
||||||
|
Loading…
Reference in New Issue
Block a user