From 5b64b477548a4294e16e2650a0b55530450cd0f6 Mon Sep 17 00:00:00 2001 From: Kevin Veen-Birkenbach Date: Fri, 15 Aug 2025 23:18:44 +0200 Subject: [PATCH] Added no_log --- roles/web-app-espocrm/tasks/01_patch_config.yml | 1 + roles/web-app-matomo/tasks/database.yml | 4 ++++ roles/web-app-moodle/tasks/01_patch_config.yml | 1 + roles/web-app-wordpress/tasks/01_patch_config.yml | 1 + 4 files changed, 7 insertions(+) diff --git a/roles/web-app-espocrm/tasks/01_patch_config.yml b/roles/web-app-espocrm/tasks/01_patch_config.yml index 14973fc8..44fa7de5 100644 --- a/roles/web-app-espocrm/tasks/01_patch_config.yml +++ b/roles/web-app-espocrm/tasks/01_patch_config.yml @@ -21,6 +21,7 @@ docker exec --user root {{ espocrm_name }} sed -i "s/'password' => .*/'password' => '{{ database_password }}',/" {{ espocrm_config_file }} notify: docker compose restart + no_log: "{{ MASK_CREDENTIALS_IN_LOGS | bool }}" - name: Ensure siteUrl matches canonical domain ansible.builtin.shell: | diff --git a/roles/web-app-matomo/tasks/database.yml b/roles/web-app-matomo/tasks/database.yml index 670b3035..ba48670e 100644 --- a/roles/web-app-matomo/tasks/database.yml +++ b/roles/web-app-matomo/tasks/database.yml @@ -2,15 +2,19 @@ command: > docker exec --user root {{ matomo_name }} sed -i "s/^host *=.*/host = {{ database_host }}/" {{ matomo_config }} + - name: Update DB name command: > docker exec --user root {{ matomo_name }} sed -i "s/^dbname *=.*/dbname = {{ database_name }}/" {{ matomo_config }} + - name: Update DB user command: > docker exec --user root {{ matomo_name }} sed -i "s/^username *=.*/username = {{ database_username }}/" {{ matomo_config }} + - name: Update DB password command: > docker exec --user root {{ matomo_name }} sed -i "s/^password *=.*/password = {{ database_password }}/" {{ matomo_config }} + no_log: "{{ MASK_CREDENTIALS_IN_LOGS | bool }}" diff --git a/roles/web-app-moodle/tasks/01_patch_config.yml b/roles/web-app-moodle/tasks/01_patch_config.yml index 793d648c..cb1116e3 100644 --- a/roles/web-app-moodle/tasks/01_patch_config.yml +++ b/roles/web-app-moodle/tasks/01_patch_config.yml @@ -21,6 +21,7 @@ docker exec --user root {{ moodle_container }} sed -i "s/^\$CFG->dbpass *= *.*/\$CFG->dbpass = '{{ database_password }}';/" {{ moodle_config }} notify: docker compose restart + no_log: "{{ MASK_CREDENTIALS_IN_LOGS | bool }}" - name: Update CFG->wwwroot via sed in container command: > diff --git a/roles/web-app-wordpress/tasks/01_patch_config.yml b/roles/web-app-wordpress/tasks/01_patch_config.yml index c078b36e..4c42870b 100644 --- a/roles/web-app-wordpress/tasks/01_patch_config.yml +++ b/roles/web-app-wordpress/tasks/01_patch_config.yml @@ -23,6 +23,7 @@ docker exec --user root {{ wordpress_container }} sed -i "s/define(\s*'DB_PASSWORD'\s*,\s*'[^']*'\s*);/define( 'DB_PASSWORD', '{{ database_password }}' );/i" {{ wordpress_docker_conf_path }} notify: docker compose restart + no_log: "{{ MASK_CREDENTIALS_IN_LOGS | bool }}" - name: "Flush handlers to reinitialize new database credentials" meta: flush_handlers \ No newline at end of file