Raw refactoring of roles

This commit is contained in:
2025-05-09 17:47:33 +02:00
parent 82f442f40e
commit 5b47333955
177 changed files with 1483 additions and 1041 deletions

View File

@@ -8,11 +8,11 @@
- name: install MariaDB
docker_container:
name: central-mariadb
name: "{{capplications.mariadb.hostname }}"
image: "mariadb:{{applications.mariadb.version}}" #could lead to problems with nextcloud
detach: yes
env:
MARIADB_ROOT_PASSWORD: "{{central_mariadb_root_password}}"
MARIADB_ROOT_PASSWORD: "{{applications.mariadb.credentials.root_password}}"
MARIADB_AUTO_UPGRADE: "1"
networks:
- name: central_mariadb
@@ -23,7 +23,7 @@
command: "--transaction-isolation=READ-COMMITTED --binlog-format=ROW" #for nextcloud
restart_policy: "{{docker_restart_policy}}"
healthcheck:
test: "/usr/bin/mariadb --user=root --password={{central_mariadb_root_password}} --execute \"SHOW DATABASES;\""
test: "/usr/bin/mariadb --user=root --password={{applications.mariadb.credentials.root_password}} --execute \"SHOW DATABASES;\""
interval: 3s
timeout: 1s
retries: 5
@@ -38,7 +38,7 @@
- name: Wait until the MariaDB container is healthy
community.docker.docker_container_info:
name: central-mariadb
name: "{{capplications.mariadb.hostname }}"
register: db_info
until: db_info.containers[0].State.Health.Status == "healthy"
retries: 30
@@ -53,7 +53,7 @@
name: "{{ database_name }}"
state: present
login_user: root
login_password: "{{ central_mariadb_root_password }}"
login_password: "{{ applications.mariadb.credentials.root_password }}"
login_host: 127.0.0.1
login_port: "{{database_port}}"
@@ -65,13 +65,13 @@
priv: '{{database_name}}.*:ALL'
state: present
login_user: root
login_password: "{{central_mariadb_root_password}}"
login_password: "{{applications.mariadb.credentials.root_password}}"
login_host: 127.0.0.1
login_port: "{{database_port}}"
- name: Grant database privileges
ansible.builtin.shell:
cmd: "docker exec central-mariadb mariadb -u root -p{{ central_mariadb_root_password }} -e \"GRANT ALL PRIVILEGES ON {{database_name}}.* TO '{{database_username}}'@'%';\""
cmd: "docker exec {{capplications.mariadb.hostname }} mariadb -u root -p{{ applications.mariadb.credentials.root_password }} -e \"GRANT ALL PRIVILEGES ON {{database_name}}.* TO '{{database_username}}'@'%';\""
args:
executable: /bin/bash