From 6a11cd3331d6048ec0bbd0477084b2ac5fda1664 Mon Sep 17 00:00:00 2001 From: Dima Kurguzov Date: Mon, 15 Feb 2016 17:55:29 +0300 Subject: [PATCH] Add username & password in mail task --- defaults/main.yml | 2 ++ tasks/mail.yml | 2 ++ 2 files changed, 4 insertions(+) diff --git a/defaults/main.yml b/defaults/main.yml index 04450e5..1c90c77 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -6,6 +6,8 @@ notify_message: "[{{inventory_hostname}}] has been updated by {{ansible_ssh_user notify_mail_to: "" notify_mail_cc: "" notify_mail_from: ansible@{{inventory_hostname}} +notify_mail_username: "" +notify_mail_password: "" notify_mail_host: localhost notify_mail_port: 25 notify_mail_attach: "" diff --git a/tasks/mail.yml b/tasks/mail.yml index de11bef..741a666 100644 --- a/tasks/mail.yml +++ b/tasks/mail.yml @@ -8,6 +8,8 @@ - name: Send email notify mail: to="{{notify_mail_to}}" + username="{{notify_mail_username}}" + password="{{notify_mail_password}}" host="{{notify_mail_host}}" port="{{notify_mail_port}}" subject="{{notify_message}}"