diff options
author | Fabio Alessandro Locati <me@fale.io> | 2016-12-02 15:09:20 +0000 |
---|---|---|
committer | John R Barker <john@johnrbarker.com> | 2016-12-02 15:09:20 +0000 |
commit | 414f62b2c50de975d57868183bb1cb3a25d9f151 (patch) | |
tree | 6f3e72633ed14359e4765f53c8a131852de3e8cd /notification/mail.py | |
parent | ce902b69aaa15ea38909b4b94cecce0fe67c7702 (diff) | |
download | ansible-modules-extras-414f62b2c50de975d57868183bb1cb3a25d9f151.tar.gz |
Native YAML - notification leftovers (#3626)
Diffstat (limited to 'notification/mail.py')
-rw-r--r-- | notification/mail.py | 47 |
1 files changed, 26 insertions, 21 deletions
diff --git a/notification/mail.py b/notification/mail.py index 5cab0d35..fbbdcff2 100644 --- a/notification/mail.py +++ b/notification/mail.py @@ -120,35 +120,40 @@ options: EXAMPLES = ''' # Example playbook sending mail to root -- local_action: mail subject='System {{ ansible_hostname }} has been successfully provisioned.' +- mail: + subject: 'System {{ ansible_hostname }} has been successfully provisioned.' + delegate_to: localhost # Sending an e-mail using Gmail SMTP servers -- local_action: mail - host='smtp.gmail.com' - port=587 - username=username@gmail.com - password='mysecret' - to="John Smith <john.smith@example.com>" - subject='Ansible-report' - body='System {{ ansible_hostname }} has been successfully provisioned.' +- mail: + host: smtp.gmail.com + port: 587 + username: username@gmail.com + password: mysecret + to: John Smith <john.smith@example.com> + subject: Ansible-report + body: 'System {{ ansible_hostname }} has been successfully provisioned.' + delegate_to: localhost # Send e-mail to a bunch of users, attaching files -- local_action: mail - host='127.0.0.1' - port=2025 - subject="Ansible-report" - body="Hello, this is an e-mail. I hope you like it ;-)" - from="jane@example.net (Jane Jolie)" - to="John Doe <j.d@example.org>, Suzie Something <sue@example.com>" - cc="Charlie Root <root@localhost>" - attach="/etc/group /tmp/pavatar2.png" - headers=Reply-To=john@example.com|X-Special="Something or other" - charset=utf8 +- mail: + host: 127.0.0.1 + port: 2025 + subject: Ansible-report + body: Hello, this is an e-mail. I hope you like it ;-) + from: jane@example.net (Jane Jolie) + to: John Doe <j.d@example.org>, Suzie Something <sue@example.com> + cc: Charlie Root <root@localhost> + attach: /etc/group /tmp/pavatar2.png + headers: 'Reply-To=john@example.com|X-Special="Something or other"' + charset: utf8 + delegate_to: localhost + # Sending an e-mail using the remote machine, not the Ansible controller node - mail: host: localhost port: 25 - to: 'John Smith <john.smith@example.com>' + to: John Smith <john.smith@example.com> subject: Ansible-report body: 'System {{ ansible_hostname }} has been successfully provisioned.' ''' |