From 94f581b83a6e5414d6649f7da855332697ef7354 Mon Sep 17 00:00:00 2001 From: Matt Jaynes Date: Wed, 22 Apr 2015 21:14:47 +0200 Subject: [PATCH] Document 'msg' param and fix examples The 'msg' alias for 'subject' isn't in the documentation, so adding it. In the gmail example, it uses both the 'subject' and 'msg' params, but 'msg' is an alias of 'subject', so you are essentially declaring the same param twice. If you use this example, then no subject is sent (I tested with gmail). Documentation example is updated to use 'body' as intended. Also, updated the simple example to use 'subject' instead of the 'msg' alias since it is more explicit. --- lib/ansible/modules/extras/notification/mail.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/ansible/modules/extras/notification/mail.py b/lib/ansible/modules/extras/notification/mail.py index a1ec44087d..10ef61ef2b 100644 --- a/lib/ansible/modules/extras/notification/mail.py +++ b/lib/ansible/modules/extras/notification/mail.py @@ -61,7 +61,7 @@ options: required: false subject: description: - - The subject of the email being sent. + - The subject of the email being sent. Alias: I(msg) aliases: [ msg ] required: true body: @@ -115,7 +115,7 @@ options: EXAMPLES = ''' # Example playbook sending mail to root -- local_action: mail msg='System {{ ansible_hostname }} has been successfully provisioned.' +- local_action: mail subject='System {{ ansible_hostname }} has been successfully provisioned.' # Sending an e-mail using Gmail SMTP servers - local_action: mail @@ -125,7 +125,7 @@ EXAMPLES = ''' password='mysecret' to="John Smith " subject='Ansible-report' - msg='System {{ ansible_hostname }} has been successfully provisioned.' + body='System {{ ansible_hostname }} has been successfully provisioned.' # Send e-mail to a bunch of users, attaching files - local_action: mail