-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathse-postfix-config.yml
54 lines (45 loc) · 1.32 KB
/
se-postfix-config.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
- name: Set postfix mail delivery for SE
remote_user: ulsprovision
hosts: SE_Rocky8
become: yes
tasks:
- name: Set email sender
ansible.builtin.blockinfile:
path: /etc/postfix/generic
create: true
insertafter: "EOF"
block: |
root@{{ ansible_host }} [email protected]
root [email protected]
- name: Run postmap /etc/postfix/generic
command: postmap /etc/postfix/generic
args:
creates: /etc/postfix/generic.db
- name: Append smtp_generic_maps to /etc/postfix/main.cf
ansible.builtin.blockinfile:
path: /etc/postfix/main.cf
insertafter: "EOF"
marker_begin: "BEGIN MAP"
marker_end: "END MAP"
block: |
# smtp_generic_maps
smtp_generic_maps = hash:/etc/postfix/generic
- name: Restart postfix
ansible.builtin.service:
name: postfix
state: restarted
- name: set cron recipient (backup)
community.general.cronvar:
name: mailto
value: [email protected]
user: backup
- name: set cron recipient (apache)
community.general.cronvar:
name: mailto
value: [email protected]
user: apache
- name: set cron recipient (root)
community.general.cronvar:
name: mailto
value: [email protected]
user: root