Added no_logs to mailu

This commit is contained in:
Kevin Veen-Birkenbach 2025-08-16 01:49:48 +02:00
parent 2b7950920c
commit 7ffd79ebd9
No known key found for this signature in database
GPG Key ID: 44D8F11FD62F878E
3 changed files with 18 additions and 3 deletions

View File

@ -13,6 +13,7 @@
)
changed_when: mailu_user_result.rc == 0
when: "'mail-bot' in item.value.roles or 'administrator' in item.value.roles"
no_log: "{{ MASK_CREDENTIALS_IN_LOGS | bool }}"
- name: "Change password for user '{{ mailu_user_key }};{{ mailu_user_name }}@{{ mailu_domain }}'"
command: >
@ -21,6 +22,7 @@
args:
chdir: "{{ mailu_compose_dir }}"
when: "'mail-bot' in item.value.roles or 'administrator' in item.value.roles"
no_log: "{{ MASK_CREDENTIALS_IN_LOGS | bool }}"
- name: "Create Mailu API Token for {{ mailu_user_name }}"
include_tasks: 03_create-mailu-token.yml

View File

@ -16,6 +16,7 @@
state: present
async: "{{ ASYNC_TIME if ASYNC_ENABLED | bool else omit }}"
poll: "{{ ASYNC_POLL if ASYNC_ENABLED | bool else omit }}"
no_log: "{{ MASK_CREDENTIALS_IN_LOGS | bool }}"
- name: "Set CNAME record for autoconfig"
community.general.cloudflare_dns:
@ -29,6 +30,7 @@
state: present
async: "{{ ASYNC_TIME if ASYNC_ENABLED | bool else omit }}"
poll: "{{ ASYNC_POLL if ASYNC_ENABLED | bool else omit }}"
no_log: "{{ MASK_CREDENTIALS_IN_LOGS | bool }}"
- name: "Set MX record"
community.general.cloudflare_dns:
@ -42,6 +44,7 @@
state: present
async: "{{ ASYNC_TIME if ASYNC_ENABLED | bool else omit }}"
poll: "{{ ASYNC_POLL if ASYNC_ENABLED | bool else omit }}"
no_log: "{{ MASK_CREDENTIALS_IN_LOGS | bool }}"
- name: "Set SRV records"
community.general.cloudflare_dns:
@ -63,6 +66,7 @@
#changed_when: srv_result.rc == 0 and ("An identical record already exists" not in srv_result.stdout)
async: "{{ ASYNC_TIME if ASYNC_ENABLED | bool else omit }}"
poll: "{{ ASYNC_POLL if ASYNC_ENABLED | bool else omit }}"
no_log: "{{ MASK_CREDENTIALS_IN_LOGS | bool }}"
- name: "Set SPF TXT record"
community.general.cloudflare_dns:
@ -75,6 +79,7 @@
state: present
async: "{{ ASYNC_TIME if ASYNC_ENABLED | bool else omit }}"
poll: "{{ ASYNC_POLL if ASYNC_ENABLED | bool else omit }}"
no_log: "{{ MASK_CREDENTIALS_IN_LOGS | bool }}"
- name: "Set DMARC TXT record"
community.general.cloudflare_dns:
@ -87,6 +92,7 @@
state: present
async: "{{ ASYNC_TIME if ASYNC_ENABLED | bool else omit }}"
poll: "{{ ASYNC_POLL if ASYNC_ENABLED | bool else omit }}"
no_log: "{{ MASK_CREDENTIALS_IN_LOGS | bool }}"
- name: "Set DKIM TXT record"
community.general.cloudflare_dns:
@ -99,3 +105,4 @@
state: present
async: "{{ ASYNC_TIME if ASYNC_ENABLED | bool else omit }}"
poll: "{{ ASYNC_POLL if ASYNC_ENABLED | bool else omit }}"
no_log: "{{ MASK_CREDENTIALS_IN_LOGS | bool }}"

View File

@ -16,6 +16,7 @@
when: dkim_key_file_stat.rc != 0
args:
chdir: "{{ docker_compose.directories.instance }}"
no_log: "{{ MASK_CREDENTIALS_IN_LOGS | bool }}"
- name: Fetch DKIM private key from antispam container
shell: >
@ -26,6 +27,7 @@
register: dkim_priv_content
failed_when: dkim_priv_content.rc != 0
changed_when: false
no_log: "{{ MASK_CREDENTIALS_IN_LOGS | bool }}"
- name: Generate DKIM public key on the host
command: openssl rsa -pubout
@ -33,6 +35,7 @@
stdin: "{{ dkim_priv_content.stdout }}"
register: dkim_pub_raw
changed_when: false
no_log: "{{ MASK_CREDENTIALS_IN_LOGS | bool }}"
- name: Normalize and build Mailu DKIM TXT record
set_fact:
@ -43,7 +46,10 @@
| regex_replace('-----END PUBLIC KEY-----', '')
| regex_replace('\s+', '')
}}
no_log: "{{ MASK_CREDENTIALS_IN_LOGS | bool }}"
- name: Debug Mailu DKIM public key
debug:
msg: "Mailu DKIM public key: {{ mailu_dkim_public_key }}"
when: MODE_DEBUG | bool