main.yml 1.48 KB
Newer Older
Florian Pritz's avatar
Florian Pritz committed
1
2
3
4
5
---

- name: install postfix
  pacman: name=postfix state=present

6
- name: install template configs
7
  template: src={{item}}.j2 dest=/etc/postfix/{{item}} owner=root group=root mode=0644
Florian Pritz's avatar
Florian Pritz committed
8
  notify:
Florian Pritz's avatar
Florian Pritz committed
9
    - reload postfix
10
11
12
13
14
  with_items:
    - main.cf
    - master.cf
    - transport
    - aliases
15
    - relay_transport_map
Florian Pritz's avatar
Florian Pritz committed
16

17
- name: install additional files
18
  copy: src={{item}} dest=/etc/postfix/{{item}} owner=root group=root mode=0644
19
20
21
  with_items:
    - access_client
    - access_sender
22
    - access_sender-post-filter
23
    - access_helo
24
    - access_recipient
25
26
27
    - body_checks
    - header_checks
    - relocated
28
29
    - domains
    - mailman_compat
30

31
32
33
- name: update aliases db
  command: postalias /etc/postfix/aliases

34
35
36
37
38
- name: postmap additional files
  command: postmap /etc/postfix/{{item}}
  with_items:
    - access_client
    - access_sender
39
    - access_sender-post-filter
40
    - access_helo
41
    - access_recipient
42
43
    - transport
    - relocated
44
    - relay_transport_map
45
46
    - domains
    - mailman_compat
47

Florian Pritz's avatar
Florian Pritz committed
48
49
- name: create dhparam 2048
  command: openssl dhparam -out /etc/postfix/dh2048.pem 2048 creates=/etc/postfix/dh2048.pem
Florian Pritz's avatar
Florian Pritz committed
50
  notify:
Florian Pritz's avatar
Florian Pritz committed
51
52
53
54
    - reload postfix

- name: create dhparam 512
  command: openssl dhparam -out /etc/postfix/dh_512.pem 512 creates=/etc/postfix/dh_512.pem
Florian Pritz's avatar
Florian Pritz committed
55
  notify:
Florian Pritz's avatar
Florian Pritz committed
56
57
58
    - reload postfix

- name: start and enable postfix
Florian Pritz's avatar
Florian Pritz committed
59
  service: name=postfix enabled=yes state=started
Florian Pritz's avatar
Florian Pritz committed
60
61
62
63
64
65

- name: remove old files
  file: path={{item}} state=absent
  with_items:
    - compat_maps
    - compat_maps.db