main.yml 1.03 KB
Newer Older
Hinrikus Wolf's avatar
Hinrikus Wolf committed
1
2
3
4
5
6
7
---

- name: ensure all required postfix packages are installed
  apt: name={{ item }} state=present
  with_items: 
    - postfix
    - postfix-pcre
8
    - postfix-cdb
Hinrikus Wolf's avatar
Hinrikus Wolf committed
9
10
11
12
13
14
15
16
17
18
  tags: 
    - postfix
    - mail

- name: ensure not templated config is present
  copy: src=files/{{ item }} dest=/etc/postfix/
  with_items:
    - login_maps.pcre
    - master.cf
    - sender_login_map.hash
Hinrikus Wolf's avatar
Hinrikus Wolf committed
19
    - postscreen_whitelist
Hinrikus Wolf's avatar
Hinrikus Wolf committed
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
  notify: 
    - restart postfix
  tags:
    - postfix
    - mail

- name: ensure templated config is present
  template: src=templates/{{ item }} dest=/etc/postfix/main.cf
  with_items:
    - main.cf.j2
  notify: 
    - restart postfix
  tags:
    - postfix
    - mail
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
    
- name: ensure system alias database is present
  template: src=templates/aliases.j2 dest=/etc/aliases
  notify:
    - postmap system
  tags:
    - postfix
    - mail

- name: ensure virtual alias database is present
  template: src=templates/v_aliases.j2 dest=/etc/postfix/virtual
  notify:
    - postmap virtual
  tags:
    - postfix
    - mail
Hinrikus Wolf's avatar
Hinrikus Wolf committed
51
52
53
54
55
56

- meta: flush_handlers