# AWX 24.6.1- Default ansible modules not working- Mail, Rsync, visudo,

**URL:** <https://forum.ansible.com/t/awx-24-6-1-default-ansible-modules-not-working-mail-rsync-visudo/40629>\
**Category:** Get Help\
**Tags:** kubernetes, ansible-project, awx, ee\
**Created:** [February 26, 2025, 5:27am UTC](https://forum.ansible.com/t/awx-24-6-1-default-ansible-modules-not-working-mail-rsync-visudo/40629 "2025-02-26T05:27:33Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![vinothravindhran](https://avatars.discourse-cdn.com/v4/letter/v/9fc348/32.png) [@vinothravindhran](https://forum.ansible.com/u/vinothravindhran)\
**Post date:** [February 26, 2025, 5:27am UTC](https://forum.ansible.com/t/awx-24-6-1-default-ansible-modules-not-working-mail-rsync-visudo/40629/1 "2025-02-26T05:27:33Z")

</div>

Default ansible modules not working- Mail, Rsync, visudo,…

- I was using docker based AWX ansible earlier and able to execute all default Ansible modules and we recently migrated to kubectl based AWX ansible [with reference of [GitHub - kurokobo/awx-on-k3s: An example implementation of AWX on single node K3s using AWX Operator, with easy-to-use simplified configuration with ownership of data and passwords.](https://github.com/kurokobo/awx-on-k3s)] and now default Ansible modules not working and showing error.
- kubectl version  
Client Version: v1.29.6+k3s2  
Kustomize Version: v5.0.4-0.20230601165947-6ce0bf390ce3  
Server Version: v1.29.6+k3s2  
AWX 24.6.1
- logs

```auto
**ERROR! couldn't resolve module/action 'mail'. This often indicates a misspelling, missing collection, or incorrect module path.**

17

18

The error appears to be in '/runner/project/playbook.yml': line 37, column 7, but may

19

be elsewhere in the file depending on the exact syntax problem.

20

21

The offending line appears to be:

22

23

24

- name: Send report "{{ outputpath }}" to the mail id "{{ mail_id }}"

25

^ here

26

We could be wrong, but this one looks like it might be an issue with

27

missing quotes. Always quote template expression brackets when they

28

start a value. For instance:

29

30

with_items:

31

- {{ foo }}

32

33

Should be written as:

34

35

with_items:

36

- "{{ foo }}"

```

```auto
- code
 
   - name: Send report "{{ outputpath }}" to the mail id "{{ mail_id }}"
      mail:
        host: mailserver.com
        port: 25
        subject: EXP.O NOW facts.d Report
        body: Hello, Attached is the server Facts.d Report per your request. Enjoy! 
        from: ansible-cxp.awx@test.com
        to: "{{ mail_id }}"
        attach: "{{ outputpath }}"
      delegate_to: server
      run_once: true

```

Kindly help me to fix the issue or kindly share the steps to add default modules on AWX EE [24.6.1].  
Thanks in advance.

@kurokobo

---

<div class="post-metadata">

**Author:** ![iwt-cmd](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/iwt-cmd/32/9120_2.png) [@iwt-cmd](https://forum.ansible.com/u/iwt-cmd)\
**Post date:** [February 26, 2025, 11:55am UTC](https://forum.ansible.com/t/awx-24-6-1-default-ansible-modules-not-working-mail-rsync-visudo/40629/2 "2025-02-26T11:55:19Z")

</div>

Hi Vinoth,

That looks like “mail” is part of community.general (please let me know if you’re using a different collection) so I’m seeing a couple of potential issues:

- The current version of the AWX EE doesn’t seem to contain community.general. In this case, you would either need to use an EE that has that included or build a new EE using ansible-builder. You can use the AWX EE as a base then just extend it with additional collections. There is probably one already available on Dockerhub or Quay that has the collection but building one from scratch is good experience if you haven’t it before.  

- I also noticed you’re using the shortened module name (“mail” instead of “community.general.mail”). This is something I do as well to increase readability but you need the collections keyword at the top with a list of collections to include in the playbook. Ignore this if you already have it, just didn’t see it in the code snip  
[Using collections in a playbook — Ansible Community Documentation](https://docs.ansible.com/ansible/latest/collections_guide/collections_using_playbooks.html#simplifying-module-names-with-the-collections-keyword)

Best regards,

Joe

---

<div class="post-metadata">

**Author:** ![vinothravindhran](https://avatars.discourse-cdn.com/v4/letter/v/9fc348/32.png) [@vinothravindhran](https://forum.ansible.com/u/vinothravindhran)\
**Post date:** [February 26, 2025, 4:41pm UTC](https://forum.ansible.com/t/awx-24-6-1-default-ansible-modules-not-working-mail-rsync-visudo/40629/3 "2025-02-26T16:41:32Z")

</div>

Thank you @iwt-cmd Joe,  
It seems “community.general” has not installed, **could you please share the steps to install it.**

Regarding mail module, i have also tried “community.general.mail” option but still same error.

```auto
 podman run -it quay.io/ansible/awx-ee:24.6.1 ansible-galaxy collection list

# /usr/share/ansible/collections/ansible_collections
Collection Version
----------------------- -------
amazon.aws 8.0.1
ansible.posix 1.5.4
ansible.windows 2.4.0
awx.awx 24.6.0
azure.azcollection 2.6.0
community.vmware 4.4.0
google.cloud 1.3.0
kubernetes.core 4.0.0
kubevirt.core 1.4.0
openstack.cloud 2.2.0
ovirt.ovirt 3.2.0
redhatinsights.insights 1.2.2
theforeman.foreman 4.0.0

```

---

<div class="post-metadata">

**Author:** ![NomakCooper](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/nomakcooper/32/7309_2.png) [@NomakCooper](https://forum.ansible.com/u/NomakCooper)\
**Post date:** [February 26, 2025, 6:26pm UTC](https://forum.ansible.com/t/awx-24-6-1-default-ansible-modules-not-working-mail-rsync-visudo/40629/4 "2025-02-26T18:26:51Z")

</div>

> [@vinothravindhran](#):
>
> It seems “community.general” has not installed, **could you please share the steps to install it.**

It depends on how you want to achieve the result.

`community.general` is not present in `quay.io/ansible/awx-ee:24.6.1`, so I think you have two possible solutions:

1. **Easy way.**

2. **Advanced way.**

---

<div class="post-metadata">

**Author:** ![vinothravindhran](https://avatars.discourse-cdn.com/v4/letter/v/9fc348/32.png) [@vinothravindhran](https://forum.ansible.com/u/vinothravindhran)\
**Post date:** [February 27, 2025, 7:03am UTC](https://forum.ansible.com/t/awx-24-6-1-default-ansible-modules-not-working-mail-rsync-visudo/40629/5 "2025-02-27T07:03:38Z")

</div>

Thank you @NomakCooper  
I have tried first way, created requirements.yml file under gitlab project folder of collection folder and added necessary entry but still community.general has not added in AWX EE.  
Screen shot has attached.

And tried to run AWX job again but still getting same mail module missing error.

 ![image](https://us1.discourse-cdn.com/ansible/original/2X/0/0d89ebe6f2b9461613526d1cd5a18cb9843d2c90.png)

---

<div class="post-metadata">

**Author:** ![vinothravindhran](https://avatars.discourse-cdn.com/v4/letter/v/9fc348/32.png) [@vinothravindhran](https://forum.ansible.com/u/vinothravindhran)\
**Post date:** [February 27, 2025, 9:28am UTC](https://forum.ansible.com/t/awx-24-6-1-default-ansible-modules-not-working-mail-rsync-visudo/40629/6 "2025-02-27T09:28:16Z")

</div>

@kurokobo@NomakCooper  
I have also tried to create New custom Execution Environment using Ansible-builder by referring below link. but i am getting below error, could you please check and help on this.

server default python version is 3.9 but i tried to install with 3.11 but still getting error.

> **[awx-on-k3s/builder at main · kurokobo/awx-on-k3s](https://github.com/kurokobo/awx-on-k3s/tree/main/builder)**
>
> An example implementation of AWX on single node K3s using AWX Operator, with easy-to-use simplified configuration with ownership of data and passwords. - kurokobo/awx-on-k3s

```auto
[root@server]# /usr/bin/python3.11
Python 3.11.9 (main, Sep 11 2024, 00:00:00) [GCC 11.5.0 20240719 (Red Hat 11.5.0-2)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>>
[root@server]# vi execution-environment.yml
[root@server]# ansible-builder build --tag registry.example.com/ansible/ee:2.15-custom --container-runtime docker --verbosity 3
Ansible Builder is generating your execution environment build context.
File context/_build/requirements.yml is already up-to-date.
File context/_build/requirements.txt is already up-to-date.
File context/_build/bindep.txt is already up-to-date.
Creating context/_build/configs
File context/_build/configs/ansible.cfg is already up-to-date.
File context/_build/scripts/assemble is already up-to-date.
File context/_build/scripts/install-from-bindep is already up-to-date.
File context/_build/scripts/introspect.py is already up-to-date.
File context/_build/scripts/check_galaxy is already up-to-date.
File context/_build/scripts/check_ansible is already up-to-date.
File context/_build/scripts/pip_install is already up-to-date.
File context/_build/scripts/entrypoint is already up-to-date.
Ansible Builder is building your execution environment image. Tags: registry.example.com/ansible/ee:2.15-custom
Running command:
  docker build -f context/Dockerfile -t registry.example.com/ansible/ee:2.15-custom context
Emulate Docker CLI using podman. Create /etc/containers/nodocker to quiet msg.
[1/4] STEP 1/17: FROM quay.io/centos/centos:stream9-minimal AS base
[1/4] STEP 2/17: USER root
--> Using cache b39796a2ca659a0ab179d89b4b9175cfd34f40f4b575c80eec98f9015db652d6
--> b39796a2ca65
[1/4] STEP 3/17: ENV PIP_BREAK_SYSTEM_PACKAGES=1
--> Using cache 85985907a9587ee5c71a9b31e60f9258bd60e8db1278a7c853dfe99fe666d289
--> 85985907a958
[1/4] STEP 4/17: ARG EE_BASE_IMAGE
--> Using cache 50958b8a85083f774b46d98d90ad97eb99c4452d523c94634182bef097a530fb
--> 50958b8a8508
[1/4] STEP 5/17: ARG PYCMD
--> Using cache ea99240a2daf00f84de8bd45969fb1fbd38b3e3193bec202138db278f824e226
--> ea99240a2daf
[1/4] STEP 6/17: ARG PYPKG
--> Using cache 7fcbaaff81b1571409223c930a5faa44c0339cbb30f379fb67cc221020fcbe03
--> 7fcbaaff81b1
[1/4] STEP 7/17: ARG PKGMGR_PRESERVE_CACHE
--> Using cache e25056efb4ca106d87d3e8f1786c0d5ae57782ba1a0a49992ac0a319929d624b
--> e25056efb4ca
[1/4] STEP 8/17: ARG ANSIBLE_GALAXY_CLI_COLLECTION_OPTS
--> Using cache 63cb7991ecc968242b7044d58a943c7e132ce76dcab86bab95199661af769753
--> 63cb7991ecc9
[1/4] STEP 9/17: ARG ANSIBLE_GALAXY_CLI_ROLE_OPTS
--> Using cache 0eb11401af6c239ff29d78239944cc2b86ab8ca28f8df3642680a551726d8ddb
--> 0eb11401af6c
[1/4] STEP 10/17: ARG ANSIBLE_INSTALL_REFS
--> Using cache 699458ed97269bec9bc99bce38c67616c0e8c0aa036cf4e1793b204445086ba4
--> 699458ed9726
[1/4] STEP 11/17: ARG PKGMGR
--> Using cache 94ac57b847ca1ee6c5d24ea971927f53f2b911c70a8dc14fe8794ddc23410d61
--> 94ac57b847ca
[1/4] STEP 12/17: COPY _build/scripts/ /output/scripts/
--> Using cache cda4e385974dc0feeb254b21003843f81fba8be28fc7bfc167c1af0f614da69f
--> cda4e385974d
[1/4] STEP 13/17: COPY _build/scripts/entrypoint /opt/builder/bin/entrypoint
--> Using cache 77ccba958ce7c3f349c2d67983b3ec0083d60ca0b56465e69330b60590e2f7ab
--> 77ccba958ce7
[1/4] STEP 14/17: RUN $PKGMGR install $PYPKG -y ; if [-z $PKGMGR_PRESERVE_CACHE]; then $PKGMGR clean all; fi
--> Using cache 3c8df7f1e685e365765db1e6398114209de5e479281a3153fc6e0a08e6e7e2e3
--> 3c8df7f1e685
[1/4] STEP 15/17: RUN /output/scripts/pip_install $PYCMD
+ PYCMD=/usr/bin/python3.11
+ '[' -z /usr/bin/python3.11 ']'
+ '[' '!' -x /usr/bin/python3.11 ']'
+ echo '/usr/bin/python3.11 is not an executable'
+ exit 1
/usr/bin/python3.11 is not an executable
Error: building at STEP "RUN /output/scripts/pip_install $PYCMD": while running runtime: exit status 1

An error occurred (rc=1), see output line(s) above for details.
[root@server]#

```

---

<div class="post-metadata">

**Author:** ![NomakCooper](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/nomakcooper/32/7309_2.png) [@NomakCooper](https://forum.ansible.com/u/NomakCooper)\
**Post date:** [February 27, 2025, 4:58pm UTC](https://forum.ansible.com/t/awx-24-6-1-default-ansible-modules-not-working-mail-rsync-visudo/40629/7 "2025-02-27T16:58:53Z")

</div>

Unfortunately, I don’t know how else to help you at the moment.

> [@vinothravindhran](#):
>
> I have tried first way, created requirements.yml file under gitlab project folder of collection folder and added necessary entry but still community.general has not added in AWX EE.  
> Screen shot has attached.
> 
> And tried to run AWX job again but still getting same mail module missing error.

I correctly use the `requirements.yml` file in my project on my AWX work environment; please check that the AWX project is properly updated with the GitLab project.

Suggestions:

- Blank lines are allowed, but it’s better to remove them, you never know.
- Always use the full module syntax, such as **`community.general.mail`**.
- Try checking with a playbook by running a task with `delegate_to` `localhost` to verify the list of installed collections.

> [@vinothravindhran](#):
>
> I have also tried to create New custom Execution Environment using Ansible-builder by referring below link. but i am getting below error, could you please check and help on this.
> 
> server default python version is 3.9 but i tried to install with 3.11 but still getting error.

I followed the guide you provided on my `CentOS Stream 9` host with `python3.11`, and `ansible-builder` works correctly.

```bash
# cat /etc/redhat-release
CentOS Stream release 9

```

```bash
# python3.11 --version
Python 3.11.5

```

```bash
# which python3.11
/usr/local/bin/python3.11

```

I followed the guide without changing anything except the `requirements.yml` file.

```bash
git clone https://github.com/kurokobo/awx-on-k3s.git
cd awx-on-k3s/builder

```

```bash
# cat dependencies/requirements.yml
---
collections:
  - name: community.general
    version: 10.1.0
    source: https://galaxy.ansible.com

```

```bash
# ansible-builder build --tag registry.example.com/ansible/ee:2.15-custom --container-runtime docker --verbosity 3
...
...
...
Successfully tagged registry.example.com/ansible/ee:2.15-custom
a3ea2d8254df02afa2e9cf66f23b8a20ea9a3387743ebcfe213d73a428332a4f

Complete! The build context can be found at: /root/awx-on-k3s/builder/context

```

```bash
# docker image ls registry.example.com/ansible/ee:2.15-custom
Emulate Docker CLI using podman. Create /etc/containers/nodocker to quiet msg.
REPOSITORY TAG IMAGE ID CREATED SIZE
registry.example.com/ansible/ee 2.15-custom a3ea2d8254df 2 minutes ago 297 MB

```

```bash
# podman run -it registry.example.com/ansible/ee:2.15-custom ansible-galaxy collection list

# /usr/share/ansible/collections/ansible_collections
Collection Version
----------------- -------
community.general 10.1.0

```

---

<div class="post-metadata">

**Author:** ![kurokobo](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/kurokobo/32/182_2.png) [@kurokobo](https://forum.ansible.com/u/kurokobo)\
**Post date:** [March 1, 2025, 4:47am UTC](https://forum.ansible.com/t/awx-24-6-1-default-ansible-modules-not-working-mail-rsync-visudo/40629/8 "2025-03-01T04:47:45Z")

</div>

+1 for @NomakCooper

After your `collections/requirements.yml` is added to your project, **you have to sync your project** in AWX, since the installation of the specified collections is one of the steps of updating your project.

Then refer to the logs of the job to update your project to see if the collections are installed for your project.

---

<div class="post-metadata">

**Author:** ![vinothravindhran](https://avatars.discourse-cdn.com/v4/letter/v/9fc348/32.png) [@vinothravindhran](https://forum.ansible.com/u/vinothravindhran)\
**Post date:** [March 3, 2025, 12:07pm UTC](https://forum.ansible.com/t/awx-24-6-1-default-ansible-modules-not-working-mail-rsync-visudo/40629/9 "2025-03-03T12:07:41Z")

</div>

Thank you @NomakCooper for checking on local setup.  
For Easy way -  
For Advanced way - I will try to do fresh OS installation and try again on another server.

---

<div class="post-metadata">

**Author:** ![vinothravindhran](https://avatars.discourse-cdn.com/v4/letter/v/9fc348/32.png) [@vinothravindhran](https://forum.ansible.com/u/vinothravindhran)\
**Post date:** [March 3, 2025, 12:08pm UTC](https://forum.ansible.com/t/awx-24-6-1-default-ansible-modules-not-working-mail-rsync-visudo/40629/10 "2025-03-03T12:08:59Z")

</div>

Thank you very much @kurokobo  
While sync my project in AWX, i got below error, i will check and update here.

 ![image](https://us1.discourse-cdn.com/ansible/original/2X/1/1b06988367a74fb05a3bdd095448b5eff0007cdc.png)

---

<div class="post-metadata">

**Author:** ![NomakCooper](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/nomakcooper/32/7309_2.png) [@NomakCooper](https://forum.ansible.com/u/NomakCooper)\
**Post date:** [March 3, 2025, 1:05pm UTC](https://forum.ansible.com/t/awx-24-6-1-default-ansible-modules-not-working-mail-rsync-visudo/40629/11 "2025-03-03T13:05:42Z")

</div>

> [@vinothravindhran](#):
>
> While sync my project in AWX, i got below error, i will check and update here.

It appears that your environment cannot reach the Ansible Galaxy servers, and for this reason, the installation and sync of the project are not being performed.

If you are unable to reach the Galaxy servers for the installation process, you can try using the tarball archive:

- Manually download the version you are interested in from [Ansible Galaxy](https://galaxy.ansible.com/ui/repo/published/community/general/).

- Upload the tarball into the **`collections`** directory.

- Change the **`requirements.yml`** file to this:

Perhaps this could work.

---

<div class="post-metadata">

**Author:** ![vinothravindhran](https://avatars.discourse-cdn.com/v4/letter/v/9fc348/32.png) [@vinothravindhran](https://forum.ansible.com/u/vinothravindhran)\
**Post date:** [March 4, 2025, 11:06am UTC](https://forum.ansible.com/t/awx-24-6-1-default-ansible-modules-not-working-mail-rsync-visudo/40629/13 "2025-03-04T11:06:08Z")

</div>

Thank you very much @NomakCooper  
Manually i have downloaded the tar file and placed under collections directory and updated the requirements.yml file.  
Now i successfully able to sync the project and mail module is working fine.🙂 🙂

Finally it is working fine.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/ansible/original/1X/1882d9a01da5d8996a862359b0913cc568a39b84.svg) [@system](https://forum.ansible.com/u/system)\
**Post date:** [April 3, 2025, 11:06am UTC](https://forum.ansible.com/t/awx-24-6-1-default-ansible-modules-not-working-mail-rsync-visudo/40629/14 "2025-04-03T11:06:57Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
