I am running ansible on a macbook pro. when i use mail Mod like this...
- name: Send Emails
local_action: mail
subject="Company WFI Report -- Automated email"
body="This email is automated contact Colin Mackenzie
if you have problems"
from="[email protected]"
to="[email protected], [email protected],
[email protected]"
cc="[email protected]"
attach='/Users/mackc/ansible/reports/{{
inventory_hostname }}-WFIActiveViewers-{{ filename_date_part }}.txt'
charset=utf8
I get this error:
fatal: [WEBNODE1 -> localhost]: FAILED! => {"changed": false, "failed":
true, "invocation": {"module_args": {"attach":
"/Users/mackc/ansible/reports/WEBNODE1-WFIActiveViewers-20160602124241UTC.txt",
"bcc": null, "body": "This email is automated contact Colin Mackenzie if
you have problems", "cc": "[email protected]", "charset": "utf8",
"from": "[email protected]", "headers": null, "host":
"localhost", "password": null, "port": "25", "sender":
"[email protected]", "subject": Compnay WFI Report -- Automated email",
"subtype": "plain", "to": "[email protected],
[email protected], [email protected]", "username": null},
"module_name": "mail"}, "msg": "Failed to send mail to server localhost on
port 25: [Errno 61] Connection refused", "rc": 1}
I can send email fine from the command line like this:
uuencode /Users/mackc/ansible/reports/areport areport | mail -s "Company
Report" [email protected]
What am i missing so i can send email from ansible playbook i have?
Thanks for anyone taking the time to respond.
-cm3
--
You received this message because you are subscribed to the Google Groups
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/ansible-project/51cd4b3c-e93a-4abb-a147-9300e865b01f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.