xoxys.postfix_relay/tasks/config_univention.yml

38 lines
984 B
YAML
Raw Normal View History

2019-08-24 13:01:30 +00:00
---
2024-02-18 11:42:08 +00:00
- name: Set postfix settings to registry
xoxys.general.ucr:
2024-02-18 11:42:08 +00:00
path: "{{ item.path }}"
value: "{{ item.value }}"
state: "{{ item.state | default('present') }}"
loop: "{{ __postfix_registry_settings }}"
2024-09-29 12:08:03 +00:00
loop_control:
2024-09-29 12:12:57 +00:00
label: "{{ item.path }}={{ item.value }}"
2019-08-24 14:12:21 +00:00
2024-02-18 11:42:08 +00:00
- name: Create smtp_auth
ansible.builtin.template:
src: etc/postfix/sasl_passwd.j2
dest: /etc/postfix/smtp_auth
owner: root
group: root
mode: "0600"
register: __auth_result
2019-08-24 13:01:30 +00:00
2024-02-18 11:42:08 +00:00
- name: Ensure smtp_auth.db exist
ansible.builtin.stat:
path: /etc/postfix/smtp_auth.db
register: __authdb
2019-08-24 13:01:30 +00:00
2024-02-18 11:42:08 +00:00
- name: Create smtp_auth.db
ansible.builtin.command: /usr/sbin/postmap hash:/etc/postfix/smtp_auth
changed_when: False
2024-02-18 11:42:08 +00:00
when: not __authdb.stat.exists or __auth_result.changed
notify: __postfix_restart
2019-08-24 13:01:30 +00:00
2024-02-18 11:42:08 +00:00
- name: Set permissions for smtp_auth.db
ansible.builtin.file:
path: /etc/postfix/smtp_auth.db
owner: root
group: root
mode: "0600"
notify: __postfix_restart