From 92aac478958d2a452550ef6646db7eadd6fc7eea Mon Sep 17 00:00:00 2001 From: nd Date: Sat, 7 Oct 2017 03:25:51 +0200 Subject: [PATCH] initial commit --- defaults/main.yml | 4 ++++ tasks/main.yml | 6 ++++++ templates/smtp.conf.j2 | 21 +++++++++++++++++++++ 3 files changed, 31 insertions(+) create mode 100644 defaults/main.yml create mode 100644 tasks/main.yml create mode 100644 templates/smtp.conf.j2 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