Deploy nullmailer
Signed-off-by: Yohann D'ANELLO <ynerant@crans.org>
This commit is contained in:
parent
b592afcd38
commit
361125e4a5
8
group_vars/all/nullmailer.yml
Normal file
8
group_vars/all/nullmailer.yml
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
---
|
||||||
|
glob_nullmailer:
|
||||||
|
root: root@ynerant.fr
|
||||||
|
smtp_server: smtp.adm.ynerant.fr
|
||||||
|
defaulthost: ynerant.fr
|
||||||
|
allmailfrom: root@ynerant.fr
|
||||||
|
username: noreply@ynerant.fr
|
||||||
|
password: "{{ vault.mailu_password }}"
|
3
hosts
3
hosts
@ -18,6 +18,9 @@ ynerant-pc.fil.sand.auro.re
|
|||||||
ynerant-thinkpad.wifi.sand.auro.re
|
ynerant-thinkpad.wifi.sand.auro.re
|
||||||
localhost
|
localhost
|
||||||
|
|
||||||
|
[postfix]
|
||||||
|
mailu.adm.ynerant.fr
|
||||||
|
|
||||||
[reverseproxy]
|
[reverseproxy]
|
||||||
proxy.adm.ynerant.fr
|
proxy.adm.ynerant.fr
|
||||||
|
|
||||||
|
@ -6,6 +6,7 @@
|
|||||||
- import_playbook: ntp.yml
|
- import_playbook: ntp.yml
|
||||||
- import_playbook: ldap-client.yml
|
- import_playbook: ldap-client.yml
|
||||||
- import_playbook: home.yml
|
- import_playbook: home.yml
|
||||||
|
- import_playbook: nullmailer.yml
|
||||||
|
|
||||||
- hosts: debian
|
- hosts: debian
|
||||||
roles:
|
roles:
|
||||||
|
7
plays/nullmailer.yml
Executable file
7
plays/nullmailer.yml
Executable file
@ -0,0 +1,7 @@
|
|||||||
|
#!/usr/bin/env ansible-playbook
|
||||||
|
---
|
||||||
|
- hosts: debian,!postfix
|
||||||
|
vars:
|
||||||
|
nullmailer: "{{ glob_nullmailer | default({}) | combine(loc_nullmailer | default({})) }}"
|
||||||
|
roles:
|
||||||
|
- nullmailer
|
34
roles/nullmailer/tasks/main.yml
Normal file
34
roles/nullmailer/tasks/main.yml
Normal file
@ -0,0 +1,34 @@
|
|||||||
|
---
|
||||||
|
- name: Install nullmailer
|
||||||
|
apt:
|
||||||
|
update_cache: true
|
||||||
|
name:
|
||||||
|
- nullmailer
|
||||||
|
- bsd-mailx
|
||||||
|
register: apt_result
|
||||||
|
retries: 3
|
||||||
|
until: apt_result is succeeded
|
||||||
|
|
||||||
|
- name: Set nullmailer remotes
|
||||||
|
copy:
|
||||||
|
content: "{{ nullmailer.smtp_server }} smtp --auth-login --user={{ nullmailer.username }} --pass='{{ nullmailer.password }}'\n"
|
||||||
|
dest: /etc/nullmailer/remotes
|
||||||
|
mode: 0644
|
||||||
|
|
||||||
|
- name: Set nullmailer adminaddr
|
||||||
|
copy:
|
||||||
|
content: "{{ nullmailer.root }}\n"
|
||||||
|
dest: /etc/nullmailer/adminaddr
|
||||||
|
mode: 0644
|
||||||
|
|
||||||
|
- name: Set nullmailer defaulthost
|
||||||
|
copy:
|
||||||
|
content: "{{ nullmailer.defaulthost }}\n"
|
||||||
|
dest: /etc/nullmailer/defaulthost
|
||||||
|
mode: 0644
|
||||||
|
|
||||||
|
- name: Set nullmailer allmailfrom
|
||||||
|
copy:
|
||||||
|
content: "{{ nullmailer.allmailfrom }}\n"
|
||||||
|
dest: /etc/nullmailer/allmailfrom
|
||||||
|
mode: 0644
|
Loading…
Reference in New Issue
Block a user