28 lines
862 B
YAML
28 lines
862 B
YAML
---
|
|
- name: Ensure aliases are present
|
|
lineinfile:
|
|
path: '/etc/aliases'
|
|
regexp: "^{{ item.local_name }}: "
|
|
line: "{{ item.local_name }}: {{ item.mail }}"
|
|
create: yes
|
|
backup: yes
|
|
loop: "{{ mail_aliases }}"
|
|
notify: Refresh aliases
|
|
|
|
- name: Ensure mail passwords is configured
|
|
lineinfile:
|
|
path: /etc/postfix/smtp_passwords
|
|
regexp: "^{{ primary_mail_server }}::{{ primary_mail_server_port }} "
|
|
line: "{{ primary_mail_server }}::{{ primary_mail_server_port }} {{ mail_user }}@{{ mail_domains[0] }}:{{ mail_user_password }}"
|
|
create: yes
|
|
backup: yes
|
|
notify: Update passwords
|
|
|
|
- name: Ensure postfix is configured
|
|
lineinfile:
|
|
path: /etc/postfix/main.cf
|
|
regexp: "^{{ item.key }}"
|
|
line: '{{ item.key }} = {{ item.value }}'
|
|
backup: yes
|
|
loop: "{{ postfix_config | dict2items }}"
|
|
notify: Reload postfix
|