From a56c8ebff19a1c6ccc1d801e04e344cae6322b0a 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. --- notification/mail.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/notification/mail.py b/notification/mail.py index a1ec44087dd..10ef61ef2be 100644 --- a/notification/mail.py +++ b/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