srs.yml 745 Bytes
Newer Older
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
---

- name: ensure we got the SRS daemon installed
  apt:
    state: "{{ 'present' if postfix_enable_srs else 'absent' }}"
    name: postsrsd

- name: ensure there is an (Debian-generated) secrets file
  file:
    path: /etc/postsrsd.secret
    state: file
    owner: root
    group: root
    mode: '0600'
  when: postfix_enable_srs

- name: ensure the SRS daemon is configured
  template:
    src: postsrsd.j2
    dest: /etc/default/postsrsd
    owner: root
    group: root
    mode: '0644'
  when: postfix_enable_srs
  notify:
    - restart postsrsd

- name: ensure the SRS daemon is up and running
  service:
    name: postsrsd
    enabled: "{{ postfix_enable_srs|string }}"
    state: "{{ 'started' if postfix_enable_srs else 'stopped' }}"