fix: handle None from lookup('file') when postfix-accounts.cf doesn't exist
lookup(..., errors='ignore') returns None (not empty string) for missing files.
Use | default('', true) to also convert falsy None to empty string.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
644b5b74c1
commit
836d554e7b
1 changed files with 1 additions and 1 deletions
|
|
@ -145,7 +145,7 @@
|
||||||
- { address: "jack@{{ domain_base }}", password: "{{ mailserver_jack_password }}" }
|
- { address: "jack@{{ domain_base }}", password: "{{ mailserver_jack_password }}" }
|
||||||
when: >
|
when: >
|
||||||
not postfix_accounts_file.stat.exists or
|
not postfix_accounts_file.stat.exists or
|
||||||
item.address not in (lookup('file', tools_root + '/mailserver/config/postfix-accounts.cf', errors='ignore') | default(''))
|
item.address not in (lookup('file', tools_root + '/mailserver/config/postfix-accounts.cf', errors='ignore') | default('', true))
|
||||||
|
|
||||||
# ── DKIM ─────────────────────────────────────────────────────────────────────
|
# ── DKIM ─────────────────────────────────────────────────────────────────────
|
||||||
- name: Check if DKIM key exists
|
- name: Check if DKIM key exists
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue