aboutsummaryrefslogtreecommitdiffstats
path: root/roles/nullmailer/tasks/main.yml
blob: d694173b03e6fef20920f2f1307311a56cd974ea (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
32
33
---
- name: Install nullmailer and mailx
  apt: name={{ item }} state=installed
  with_items:
    - nullmailer
    - heirloom-mailx
  tags:
    - dependencies

- name: Enable and run nullmailer service
  service:
    name: nullmailer
    enabled: yes
    state: restarted

- name: Configure nullmailer - adminaddr
  template: src=etc_nullmailer_adminaddr.j2 dest=/etc/nullmailer/adminaddr
  when: admin_email is defined

- name: Configure nullmailer - defaultdomain
  template: src=etc_nullmailer_defaultdomain.j2 dest=/etc/nullmailer/defaultdomain
  when: email_domain is defined

- name: Configure nullmailer - remotes
  template: src=etc_nullmailer_remotes.j2 dest=/etc/nullmailer/remotes
  when: nullmailer_smtp_pass is defined
  notify: reload nullmailer

- name: Create mailname
  template: src=mailname.j2 dest=/etc/mailname mode=0644
  when: email_domain is defined
  notify: reload nullmailer