diff options
Diffstat (limited to 'roles/nullmailer/tasks')
-rw-r--r-- | roles/nullmailer/tasks/main.yml | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/roles/nullmailer/tasks/main.yml b/roles/nullmailer/tasks/main.yml new file mode 100644 index 0000000..d694173 --- /dev/null +++ b/roles/nullmailer/tasks/main.yml @@ -0,0 +1,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 + |