Moved blocks to include_tasks to raise performance. Deploy was really slow

This commit is contained in:
2025-08-11 12:28:31 +02:00
parent b6e571a496
commit 6e04ac58d2
52 changed files with 609 additions and 628 deletions

View File

@@ -0,0 +1,30 @@
- name: "Create database: {{ database_name }}"
mysql_db:
name: "{{ database_name }}"
state: present
login_user: root
login_password: "{{ mariadb_root_pwd }}"
login_host: 127.0.0.1
login_port: "{{ database_port }}"
encoding: "{{ database_encoding }}"
collation: "{{ database_collation }}"
- name: "Create database user: {{ database_username }}"
mysql_user:
name: "{{database_username}}"
password: "{{database_password}}"
host: "%"
priv: '{{database_name}}.*:ALL'
state: present
login_user: root
login_password: "{{mariadb_root_pwd}}"
login_host: 127.0.0.1
login_port: "{{database_port}}"
# Deactivated due to https://chatgpt.com/share/683ba14b-0e74-800f-9ad1-a8979bc77093
# @todo Remove if this works fine in the future.
#- name: Grant database privileges
# ansible.builtin.shell:
# cmd: "docker exec {{mariadb_name }} mariadb -u root -p{{ mariadb_root_pwd }} -e \"GRANT ALL PRIVILEGES ON `{{database_name}}`.* TO '{{database_username}}'@'%';\""
# args:
# executable: /bin/bash