commit 92aac478958d2a452550ef6646db7eadd6fc7eea Author: nd Date: Sat Oct 7 03:25:51 2017 +0200 initial commit diff --git a/defaults/main.yml b/defaults/main.yml new file mode 100644 index 0000000..fd90004 --- /dev/null +++ b/defaults/main.yml @@ -0,0 +1,4 @@ +mail: + root: "root@example.com" + server: "mail.example.com" + domain: "example.com" diff --git a/tasks/main.yml b/tasks/main.yml new file mode 100644 index 0000000..96fe048 --- /dev/null +++ b/tasks/main.yml @@ -0,0 +1,6 @@ +- name: install ssmtp + apt: pkg=ssmtp state=latest +- name: setup ssmtp + template: + src: smtp.conf.j2 + dest: /etc/ssmtp/ssmtp.conf diff --git a/templates/smtp.conf.j2 b/templates/smtp.conf.j2 new file mode 100644 index 0000000..783aa6d --- /dev/null +++ b/templates/smtp.conf.j2 @@ -0,0 +1,21 @@ +# +# Config file for sSMTP sendmail +# +# The person who gets all mail for userids < 1000 +# Make this empty to disable rewriting. +root={{ mail['root'] }} + +# The place where the mail goes. The actual machine name is required no +# MX records are consulted. Commonly mailhosts are named mail.domain.com +mailhub={{ mail['server'] }} + +# Where will the mail seem to come from? +rewriteDomain={{ mail['domain'] }} + +# The full hostname +hostname={{ inventory_hostname }} + +# Are users allowed to set their own From: address? +# YES - Allow the user to specify their own From: address +# NO - Use the system generated From: address +FromLineOverride=YES