summaryrefslogtreecommitdiff
path: root/ansible/roles/smarthost-client/tasks/main.yml
blob: 899f736d726427f336d85384b04861ee24f940e7 (plain)
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
# A mail client needs to send mail. I prefer to send via a local MTA,
# which routes things out via a smarthost.

- name: install postfix
  apt: name=postfix

- name: configure postfix
  template:
    src: main.cf
    dest: /etc/postfix/main.cf
  notify: restart postfix

- name: set mailname
  copy:
    content: "{{ mailname }}\n"
    dest: /etc/mailname
    owner: root
    group: root
    mode: 0644

# Set up the smarthost relay credentials.

- name: set smarthost relay credentials
  template:
    src: sasl_passwd
    dest: /etc/postfix/sasl_passwd
    mode: 0600

- name: postmap relay credentials
  shell: |
    postmap /etc/postfix/sasl_passwd