diff --git a/docs/roles/cache_clear/cache_clear-opcache.md b/docs/roles/cache_clear/cache_clear-opcache.md index 465307e2..bb0bd05d 100644 --- a/docs/roles/cache_clear/cache_clear-opcache.md +++ b/docs/roles/cache_clear/cache_clear-opcache.md @@ -18,7 +18,7 @@ cache_clear_opcache: # Bins to clear. clear_opcache: true clear_apcu: false - clear_stat: false + clear_stat: true # cachetool_bin: "/path/to/cachetool.phar" # see _init for paths if undefined ``` diff --git a/docs/roles/database_backup/database_backup-mysql.md b/docs/roles/database_backup/database_backup-mysql.md index 3a7ec471..6637e2da 100644 --- a/docs/roles/database_backup/database_backup-mysql.md +++ b/docs/roles/database_backup/database_backup-mysql.md @@ -8,6 +8,8 @@ mysql_backup: handling: rolling dumps_directory: "/home/{{ deploy_user }}/shared/{{ project_name }}_{{ build_type }}/db_backups/mysql/build" mysqldump_params: "{{ _mysqldump_params }}" # set in _init but you can override here + # Location on deploy server where the generated MySQL password will be stashed - should be temporary storage + mysql_password_path: "/tmp/.ce-deploy/{{ project_name }}_{{ build_type }}_{{ build_number }}" # Number of dumps/db to keep. Note this is independant from the build codebases. keep: 10 # This can be one of the following: @@ -27,6 +29,7 @@ mysql_backup: credentials_file: "/home/{{ deploy_user }}/.mysql.creds" #handling: static # optional override to the main handling method on a per database basis + ``` diff --git a/roles/cache_clear/cache_clear-opcache/README.md b/roles/cache_clear/cache_clear-opcache/README.md index 465307e2..bb0bd05d 100644 --- a/roles/cache_clear/cache_clear-opcache/README.md +++ b/roles/cache_clear/cache_clear-opcache/README.md @@ -18,7 +18,7 @@ cache_clear_opcache: # Bins to clear. clear_opcache: true clear_apcu: false - clear_stat: false + clear_stat: true # cachetool_bin: "/path/to/cachetool.phar" # see _init for paths if undefined ``` diff --git a/roles/database_backup/database_backup-mysql/README.md b/roles/database_backup/database_backup-mysql/README.md index 3a7ec471..6637e2da 100644 --- a/roles/database_backup/database_backup-mysql/README.md +++ b/roles/database_backup/database_backup-mysql/README.md @@ -8,6 +8,8 @@ mysql_backup: handling: rolling dumps_directory: "/home/{{ deploy_user }}/shared/{{ project_name }}_{{ build_type }}/db_backups/mysql/build" mysqldump_params: "{{ _mysqldump_params }}" # set in _init but you can override here + # Location on deploy server where the generated MySQL password will be stashed - should be temporary storage + mysql_password_path: "/tmp/.ce-deploy/{{ project_name }}_{{ build_type }}_{{ build_number }}" # Number of dumps/db to keep. Note this is independant from the build codebases. keep: 10 # This can be one of the following: @@ -27,6 +29,7 @@ mysql_backup: credentials_file: "/home/{{ deploy_user }}/.mysql.creds" #handling: static # optional override to the main handling method on a per database basis + ``` diff --git a/roles/database_backup/database_backup-mysql/defaults/main.yml b/roles/database_backup/database_backup-mysql/defaults/main.yml index 777cc6f9..1091f8d7 100644 --- a/roles/database_backup/database_backup-mysql/defaults/main.yml +++ b/roles/database_backup/database_backup-mysql/defaults/main.yml @@ -3,6 +3,8 @@ mysql_backup: handling: rolling dumps_directory: "/home/{{ deploy_user }}/shared/{{ project_name }}_{{ build_type }}/db_backups/mysql/build" mysqldump_params: "{{ _mysqldump_params }}" # set in _init but you can override here + # Location on deploy server where the generated MySQL password will be stashed - should be temporary storage + mysql_password_path: "/tmp/.ce-deploy/{{ project_name }}_{{ build_type }}_{{ build_number }}" # Number of dumps/db to keep. Note this is independant from the build codebases. keep: 10 # This can be one of the following: diff --git a/roles/database_backup/database_backup-mysql/tasks/deploy.yml b/roles/database_backup/database_backup-mysql/tasks/deploy.yml index 4304c3e4..8d93c118 100644 --- a/roles/database_backup/database_backup-mysql/tasks/deploy.yml +++ b/roles/database_backup/database_backup-mysql/tasks/deploy.yml @@ -71,6 +71,11 @@ - _legacy_static_creds.stat.exists ### End of legacy handling. +- name: Ensure the temporary password directory exists. + ansible.builtin.file: + state: directory + path: "{{ mysql_backup.mysql_password_path }}" + - ansible.builtin.set_fact: _mysql_build_password: "{{ lookup('password', '{{ _ce_deploy_data_dir }}/{{ project_name }}_{{ build_type }}/mysql/{{ _mysql_host }}/{{ database.database }}') }}" when: mysql_backup.credentials_handling == 'static' @@ -79,7 +84,7 @@ _mysql_build_user_name: "{{ database.user }}_{{ build_number }}" when: mysql_backup.credentials_handling == 'rotate' - ansible.builtin.set_fact: - _mysql_build_password: "{{ lookup('password', '/dev/shm/{{ project_name }}_{{ build_type }}_{{ build_number }}') }}" + _mysql_build_password: "{{ lookup('password', '{{ mysql_backup.mysql_password_path }}') }}" when: mysql_backup.credentials_handling == 'rotate' - name: "Set database handling type to {{ mysql_backup.handling }}."