main.yml 1.36 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
Florian Pritz's avatar
Florian Pritz committed
15

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

28
29
30
- name: update aliases db
  command: postalias /etc/postfix/aliases

31
32
33
34
35
- name: postmap additional files
  command: postmap /etc/postfix/{{item}}
  with_items:
    - access_client
    - access_sender
36
    - access_sender-post-filter
37
    - access_helo
38
    - access_recipient
39
40
41
    - transport
    - relocated

Florian Pritz's avatar
Florian Pritz committed
42
43
- 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
44
  notify:
Florian Pritz's avatar
Florian Pritz committed
45
46
47
48
    - 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
49
  notify:
Florian Pritz's avatar
Florian Pritz committed
50
51
52
    - reload postfix

- name: start and enable postfix
Florian Pritz's avatar
Florian Pritz committed
53
  service: name=postfix enabled=yes state=started
Florian Pritz's avatar
Florian Pritz committed
54
55
56
57
58
59

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