From dc880692bb10ea806b6de1acfef6904081a108c8 Mon Sep 17 00:00:00 2001
From: Chris Croome <chris@webarchitects.co.uk>
Date: Thu, 4 Jan 2024 16:31:11 +0000
Subject: [PATCH] no_log for ~/.my.cnf files when templated

---
 .gitlab-ci.yml           | 1 +
 tasks/conf_templated.yml | 1 +
 2 files changed, 2 insertions(+)

diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 786939e..4026a58 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -14,6 +14,7 @@ variables:
   ANSIBLE_FORCE_COLOR: "1"
   ANSIBLE_REMOTE_TMP: "/tmp"
   ANSIBLE_SHELL_ALLOW_WORLD_READABLE_TEMP: "1"
+  DEFAULT_MANAGED_STR: "Ansible managed"
   MOLECULE_VERBOSITY: "0"
   PY_COLORS: "1"
   USER: "root"
diff --git a/tasks/conf_templated.yml b/tasks/conf_templated.yml
index 6748db2..353898d 100644
--- a/tasks/conf_templated.yml
+++ b/tasks/conf_templated.yml
@@ -32,6 +32,7 @@
         mode: "{{ mariadb_cnf.mode | default('0644') }}"
         owner: "{{ mariadb_cnf.owner | default('root') }}"
         group: "{{ mariadb_cnf.group | default('root') }}"
+      no_log: "{% if mariadb_cnf.path is regex(mariadb_regex.config_path) %}false{% else %}true{% endif %}"
       register: mariadb_cnf_file_templated
 
     - name: Notify handler to restart MariaDB
-- 
GitLab