diff --git a/defaults/main.yml b/defaults/main.yml index ac2b6af..e942eea 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -7,8 +7,8 @@ mariadb_container_max_connections: '512' mariadb_container_exposed_port: '3306' mysql_container_name: "mariadb" -MYSQL_ROOT_PASSWORD: "mysql_root_password" -MYSQL_USER: "mysql_db_user" +mysql_root_password: "mysql_root_password" +mysql_user: "mysql_db_user" mysql_password: "mysql_db_user_password" mysql_database: "mariadb_custom_database" diff --git a/tasks/main.yml b/tasks/main.yml index a3b178c..446a617 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -51,7 +51,7 @@ MYSQL_USER: "{{ mysql_user }}" MYSQL_PASSWORD: "{{ mysql_password }}" MYSQL_DATABASE: "{{ mysql_database }}" - MYSQL_ROOT_PASSWORD: "{{ MYSQL_ROOT_PASSWORD }}" + MYSQL_ROOT_PASSWORD: "{{ mysql_root_password }}" - name: "create {{ mysql_container_name }} backup directory" ansible.builtin.file: @@ -73,7 +73,7 @@ name: "Daily dump of mariadb {{ mysql_database }}" minute: "11" hour: "*/4" - job: "docker exec {{ mysql_container_name }} sh -c 'exec mariadb-dump --lock-tables --all-databases --user=root --password={{ MYSQL_ROOT_PASSWORD }}' > + job: "docker exec {{ mysql_container_name }} sh -c 'exec mariadb-dump --lock-tables --all-databases --user=root --password={{ mysql_root_password }}' > {{ container_storage_dir_base_backup }}/{{ mysql_container_name }}_backups/{{ mysql_container_name }}.sql; bzip2 -f {{ container_storage_dir_base_backup }}/{{ mysql_container_name }}_backups/{{ mysql_container_name }}.sql" tags: