I’m using AWX, and i have custom module i am facing below error even i have installed ansible and requests on the delegated host
error:{
“module_stdout”: “/etc/profile.d/lang.sh: line 19: warning: setlocale: LC_CTYPE: cannot change locale (C.UTF-8)\r\nTraceback (most recent call last):\r\n File "/home/efv-ansible/.ansible/tmp/ansible-tmp-1706729474.2440329-119-117030014921145/AnsiballZ_registerconsol.py", line 100, in \r\n _ansiballz_main()\r\n File "/home/efv-ansible/.ansible/tmp/ansible-tmp-1706729474.2440329-119-117030014921145/AnsiballZ_registerconsol.py", line 92, in _ansiballz_main\r\n invoke_module(zipped_mod, temp_path, ANSIBALLZ_PARAMS)\r\n File "/home/efv-ansible/.ansible/tmp/ansible-tmp-1706729474.2440329-119-117030014921145/AnsiballZ_registerconsol.py", line 41, in invoke_module\r\n run_name=‘main’, alter_sys=True)\r\n File "/usr/lib64/python2.7/runpy.py", line 176, in run_module\r\n fname, loader, pkg_name)\r\n File "/usr/lib64/python2.7/runpy.py", line 82, in _run_module_code\r\n mod_name, mod_fname, mod_loader, pkg_name)\r\n File "/usr/lib64/python2.7/runpy.py", line 72, in _run_code\r\n exec code in run_globals\r\n File "/tmp/ansible_registerconsol_payload_cHjRE5/ansible_registerconsol_payload.zip/ansible/modules/registerconsol.py", line 46, in \r\nImportError: No module named requests\r\n”,
“module_stderr”: “Shared connection to ansible-as-1d.sys.comcast.net closed.\r\n”,
“msg”: “MODULE FAILURE\nSee stdout/stderr for the exact error”,
“rc”: 1,
“_ansible_no_log”: false,
“changed”: false,
“_ansible_delegated_vars”: {
“ansible_host”: “ansible-as-1d.sys.comcast.net”,
“ansible_port”: null,
“ansible_user”: “efv-ansible”
}
}
- name: Telegraf host register with Prometheus
registerconsol:
Name: “{{ansible_host}}”
ip: “{{ansible_ip}}”
curl: “{{consul_register_url}}”
token: “{{consul_key}}”
function: “{{ansible_function}}”
location: “{{ansible_location}}”
itrc_component: “{{ansible_itrc_component_wthspc}}”
itrc_id: “{{ansible_itrc_cmp_id}}”
new: True
delegate_to: ansible-as-1d.sys.comcast.net
when: (location is not defined and function is not defined) or (ansible_location in location and ansible_function in function and Version in version) or (location is not defined and ansible_function in function and Version in version) or (function is not defined and ansible_location in location and Version in version)
tags: - Prometheus_Register