summaryrefslogtreecommitdiff
blob: 57b0601680c2d44606f200fa2fdf8e2441250229 (plain) (blame)
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
---
# postfix install and configuration
# note: this postfix config requires open ports: 25 and 587
- name: install postfix
  apt:
    state: latest
    pkg:
      - postfix
      - postfix-doc
      - postfix-pcre

- name: give postfix user permission to read private keys
  user:
    name: postfix
    groups: ssl-cert
    append: yes

- name: copy postfix config
  copy:
    src: postfix/
    dest: /etc/postfix/
    mode: preserve
  notify:
  - restart postfix # NB this could be a reload instead
  - rehash postfix aliases

- name: instantiate postfix main.cf template
  template:
    src: postfix/main.cf.j2
    dest: /etc/postfix/main.cf
  notify:
  - reload postfix


# verify everything is running
- name: verify services are running in dependency order
  service:
    name: "{{ item }}"
    enabled: yes
    state: started
  loop:
    - postfix

- name: reload if certs newish
  include_role:
    name: certreload
  vars:
    certreload:
      notifiers:
        - reload postfix
Powered by cgit v1.2.3 (git 2.41.0)