Community mail module not working

3,543 views
Skip to first unread message

Gregory Machin

unread,
Jul 13, 2022, 7:49:57 PM7/13/22
to Ansible Project
Hi, 
I'm running Ansible --version


ansible 2.10.8
  config file = /etc/ansible/ansible.cfg
  configured module search path = ['/root/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /usr/lib/python3/dist-packages/ansible
  executable location = /usr/bin/ansible
  python version = 3.10.4 (main, Apr  2 2022, 09:04:19) [GCC 11.2.0]
root@ansible:/etc/ansible#

on Ubuntu 22.04 

I installed the community.general collection using :
 ansible-galaxy collection install community.general

and I'm getting the following: 
[WARNING]: Collection community.general does not support Ansible version 2.10.8

which doesn't makes sense because the install page says "Installing collections with ansible-galaxy is only supported in ansible 2.9+" but my ansible version is 2.10.8 so why the warning ?

when it mail module is called in the play book I get :
fatal: [server1]: FAILED! => {"msg": "The module mail was redirected to community.general.notification.mail, which could not be loaded."}
fatal: [server2]: FAILED! => {"msg": "The module mail was redirected to community.general.notification.mail, which could not be loaded."}
fatal: [server3]: FAILED! => {"msg": "The module mail was redirected to community.general.notification.mail, which could not be loaded."

given the warning this is not a surprise.. 

How do I get the mail module to work with my current version of Ansible ?

G



Felix Fontein

unread,
Jul 14, 2022, 12:24:08 AM7/14/22
to ansible...@googlegroups.com
Hi,

> I'm running Ansible --version
>
>
> ansible 2.10.8

please note that ansible-base 2.10 is End of Life since May 2022. We
suggest to upgrade to ansible-core (2.11 or later).

> I installed the community.general collection using :
> ansible-galaxy collection install community.general
>
> and I'm getting the following:
> [WARNING]: Collection community.general does not support Ansible
> version 2.10.8
>
> which doesn't makes sense because the install page says "Installing
> collections with ansible-galaxy is only supported in ansible 2.9+"
> but my ansible version is 2.10.8 so why the warning ?

The README of community.general clearly states that ansible-base 2.10
is no longer supported with community.general 5.0.0+:

https://galaxy.ansible.com/community/general

"Tested with the current ansible-core 2.11, ansible-core 2.12,
ansible-core 2.13 releases and the current development version of
ansible-core. Ansible-core versions before 2.11.0 are not supported.
This includes all ansible-base 2.10 and Ansible 2.9 releases."

So you should install community.general < 5.0.0 if you insist working
with ansible-base 2.10.

-------

Some modules of the collection might still work with ansible-base 2.10
though, and in any case, you should get a different error message in
case community.general.mail doesn't work with ansible-base 2.10 (I
think it still works with it).

> when it mail module is called in the play book I get :
> fatal: [server1]: FAILED! => {"msg": "The module mail was redirected
> to community.general.notification.mail, which could not be loaded."}

A similar error has been reported here:
https://github.com/ansible-collections/community.general/issues/4943 in
conjunction with Execution Environments. I was not able to reproduce
it so far, but you seem to be hitting a similar instance of that error.
If you can manage to provide a reproducer.

I did try:

docker run --rm -it python:3.10 /bin/bash

and in there

pip install ansible-base==2.10.8
ansible-galaxy collection install community.general
ansible localhost -m mail

and got the error 'missing required arguments: subject' instead. I also
did try running a small playbook, and it resulted in the same error.

Cheers,
Felix


Reply all
Reply to author
Forward
0 new messages