AWX Mail Module Failed from AWX Environment

We have installed the mail module in the Executor Node and AWX-EE task pod and
We have tested the Job Template for Mail Module in AWX platform but we have found the below error. Could you please share the remediation steps for the below error issue.

Error:- ERROR! couldn’t resolve module/action ‘mail’. This often indicates a misspelling, missing collection, or incorrect module path.
The error appears to be in ‘/runner/project/test.yml’: line 8, column 7, but may
be elsewhere in the file depending on the exact syntax problem.

I’m also encountering an issue with the AWX-EE task pod where the mail module seems to be installed correctly, but when I run the Job Template, I receive an error. The error suggests a problem with resolving the module/action for ‘mail’. Here are the details:

  • Installed mail module on the Executor Node and AWX-EE task pod.

  • Tested the Job Template for Mail Module on the AWX platform.

  • Encountered error:

    ERROR! couldn’t resolve module/action ‘mail’. This often indicates a misspelling, missing collection, or incorrect module path.
    The error appears to be in ‘/runner/project/test.yml’: line 8, column 7, but may
    be elsewhere in the file depending on the exact syntax problem.
    `

Could anyone suggest remediation

Hi team, could anyone please suggest a remediation? It would be really helpful.

the mail module need to be in the job pod created by AWX when u run the job

if the module you need is not in the default EE container u need to create your on execution environment image with ansible-builder Execution environment definition — Ansible Builder Documentation

We have installed this mail module in the EE container but still I am facing the issue. Please check the below error once.

Command:- ansible localhost -m mail -a 'subject: test

Error:- [ WARNING]: No inventory was parsed, only Implicit localhost is available

ERROR! this task ‘mail’ has extra params, which is only allowed in the following modules: ansible.legacy.command, ansible.builtin.include_tasks, ansible.legacy.include tasks, ansible.legacy.meta, neta, le.builtin.shell, ansible.legacy.script, ansible.legacy.raw, ansible.builtin.raw, ansible.legacy.add_host, ansible.builtin.include, ansible.builtin.include_vars, group by, import tasks, ansible.builtim role, ansible.builtin.group_by, ansible.builtin.include_role, ansible.legacy.import_role, script, ansible.builtin.win_command, ansible.legacy.import_tasks, ansible.legacy.win_shell, ansible.windows. міли ansible.builtin.command, import_role, ansible.builtin.meta, ansible.legacy.win_command, ansible. legacy, include, ansible.windows.win_command, ansible.builtin.import_tasks, include tasks, zaw, ansible.le sible.builtin.add_host, ansible.builtin.import_role, include_vars, add host, ansible.legacy.group_by, ansible.legacy.include_vars, ansible.legacy.include_zole, ansible.legacy.shell, shell, win_command,

win_shell, set_fact, command, ansible.builtin.set_fact

Try that again, but syntactically correctly, when using adhoc:

ansible localhost -m mail -a "subject=test"

Spoiler alert: this is not going to send mail. You’ll need more parameters and a mail server, but at least you’re getting there…

1 Like