initial commit
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
commit
75891c3271
129 changed files with 8046 additions and 0 deletions
26
roles/mail/tasks/users.yml
Normal file
26
roles/mail/tasks/users.yml
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
# read-only docker exec always reports changed; changed_when: false suppresses spurious output
|
||||
- name: Check if mail user exists
|
||||
command: docker exec mailserver setup email list
|
||||
register: mail_user_list
|
||||
changed_when: false
|
||||
tags:
|
||||
- users
|
||||
|
||||
- name: Create mail users if missing
|
||||
ansible.builtin.command:
|
||||
argv:
|
||||
- docker
|
||||
- exec
|
||||
- mailserver
|
||||
- setup
|
||||
- email
|
||||
- add
|
||||
- "{{ item.address }}"
|
||||
- "{{ item.password }}"
|
||||
loop: "{{ mail_users }}"
|
||||
when: item.address not in mail_user_list.stdout
|
||||
no_log: true
|
||||
ignore_errors: yes
|
||||
tags:
|
||||
- users
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue