Configure callback mail

235 views
Skip to first unread message

Frédéric GAUTHIER BESNARD

unread,
Mar 21, 2022, 10:05:05 AM3/21/22
to Ansible Project
Hello,
I try to understand mail callback configuration.

My ansible.cfg

```
[defaults]
inventory = env/inventory.ini
library = lib
callback_enabled = timer,minimal,profile_tasks,mail
interpreter_python = /usr/bin/python3
collections_paths = .

[callback_mail]
smtpport = 465
```

But, Where I put password?
I tried with password = "mypassword', in callback_mail section, but no more works.

I created a playbook with task that I'm sure it fails. But I don't receive mail.

I tried without success:
```
callback_enabled = timer,minimal,profile_tasks,community.general.mail
```

```
ansible-playbook [core 2.12.2]
  config file = /Users/fred/labo/dev/ansible.cfg
  configured module search path = ['/Users/fred/labo/dev/lib']
  ansible python module location = /Users/fred/labo/venv/lib/python3.9/site-packages/ansible
  ansible collection location = /Users/fred/labo/dev
  executable location = /Users/fred/labo/venv/bin/ansible-playbook
  python version = 3.9.0 (v3.9.0:9cf6752276, Oct  5 2020, 11:29:23) [Clang 6.0 (clang-600.0.57)]
  jinja version = 2.11.2
  libyaml = False
Using /Users/fred/labo/457/ansible.cfg as config file
host_list declined parsing /Users/fred/labo/dev/env/inventory.ini as it did not pass its verify_file() method
auto declined parsing /Users/fred/labo/dev/env/inventory.ini as it did not pass its verify_file() method
yaml declined parsing /Users/fred/labo/dev/env/inventory.ini as it did not pass its verify_file() method
Parsed /Users/fred/labo/dev/env/inventory.ini inventory source with ini plugin
Skipping callback 'default', as we already have a stdout callback.
Skipping callback 'minimal', as we already have a stdout callback.
Skipping callback 'oneline', as we already have a stdout callback.
```

Thanks for help

Matt Martz

unread,
Mar 21, 2022, 11:35:29 AM3/21/22
to ansible...@googlegroups.com
The mail callback is intended to work with a local MTA, and not intended to work with public email services that require SMTP auth.  As such, you cannot supply a password.  You have to be able to send mail unauthenticated with this callback.

--
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 ansible-proje...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/57b5c0a0-5c99-4503-84bc-8fdec805418fn%40googlegroups.com.


--
Matt Martz
@sivel
sivel.net

Thomas Stephen Lee

unread,
Mar 21, 2022, 10:32:07 PM3/21/22
to Ansible Project Mailing List
What we usually do is install Postfix on the local machine and have
Postfix relay to the SMTP server with username/password.

Thanks

---
Lee

Frédéric GAUTHIER BESNARD

unread,
Mar 23, 2022, 2:44:26 AM3/23/22
to Ansible Project
Ok, thanks, I understand now.

But my ansible project is in docker container, so I need to intergrate postix in image.

Thanks
Reply all
Reply to author
Forward
0 new messages