Thanks Vincent for taking time to reply on the issue.
Please find below the logs from AWX after enabling verbosity.
Just to update you that am using AWX version 15.0.0 and ansible version as 2.9.13
TASK [srev_instaclustr_datadog_agent : Execute the kafka cluster script] *******
task path: /tmp/awx_1042479_szxroolb/project/roles/srev_instaclustr_datadog_agent/tasks/main.yml:64
Monday 06 December 2021 09:43:48 +0000 (0:00:01.634) 0:04:44.382 *******
<xx.3.21.224> ESTABLISH SSH CONNECTION FOR USER: ec2-user
<xx.3.21.224> SSH: EXEC ssh -C -o ControlMaster=auto -o ControlPersist=60s -o PreferredAuthentications=publickey -o StrictHostKeyChecking=no -o Port=2222 -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o ‘User=“ec2-user”’ -o ConnectTimeout=10 -o ControlPath=/tmp/awx_1042479_szxroolb/cp/f80bf129af xx.3.21.224 ‘/bin/sh -c ‘"’“‘echo ~ec2-user && sleep 0’”’“‘’
<xx.3.21.224> (0, b’/home/ec2-user\n’, b’')
<xx.3.21.224> ESTABLISH SSH CONNECTION FOR USER: ec2-user
<xx.3.21.224> SSH: EXEC ssh -C -o ControlMaster=auto -o ControlPersist=60s -o PreferredAuthentications=publickey -o StrictHostKeyChecking=no -o Port=2222 -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o ‘User=“ec2-user”’ -o ConnectTimeout=10 -o ControlPath=/tmp/awx_1042479_szxroolb/cp/f80bf129af xx.3.21.224 '/bin/sh -c '”‘"’( umask 77 && mkdir -p “echo /home/ec2-user/.ansible/tmp
”&& mkdir “echo /home/ec2-user/.ansible/tmp/ansible-tmp-1638783828.3375993-1054-195071821294354
” && echo ansible-tmp-1638783828.3375993-1054-195071821294354=“echo /home/ec2-user/.ansible/tmp/ansible-tmp-1638783828.3375993-1054-195071821294354
” ) && sleep 0’“'”‘’
<xx.3.21.224> (0, b’ansible-tmp-1638783828.3375993-1054-195071821294354=/home/ec2-user/.ansible/tmp/ansible-tmp-1638783828.3375993-1054-195071821294354\n’, b’‘)
Using module file /usr/lib/python3.6/site-packages/ansible/modules/commands/command.py
<xx.3.21.224> PUT /var/lib/awx/.ansible/tmp/ansible-local-311004e45k68c/tmpq32tuwr6 TO /home/ec2-user/.ansible/tmp/ansible-tmp-1638783828.3375993-1054-195071821294354/AnsiballZ_command.py
<xx.3.21.224> SSH: EXEC sftp -b - -C -o ControlMaster=auto -o ControlPersist=60s -o PreferredAuthentications=publickey -o StrictHostKeyChecking=no -o Port=2222 -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o ‘User=“ec2-user”’ -o ConnectTimeout=10 -o ControlPath=/tmp/awx_1042479_szxroolb/cp/f80bf129af ‘[xx.3.21.224]’
<xx.3.21.224> (0, b’sftp> put /var/lib/awx/.ansible/tmp/ansible-local-311004e45k68c/tmpq32tuwr6 /home/ec2-user/.ansible/tmp/ansible-tmp-1638783828.3375993-1054-195071821294354/AnsiballZ_command.py\n’, b’‘)
<xx.3.21.224> ESTABLISH SSH CONNECTION FOR USER: ec2-user
<xx.3.21.224> SSH: EXEC ssh -C -o ControlMaster=auto -o ControlPersist=60s -o PreferredAuthentications=publickey -o StrictHostKeyChecking=no -o Port=2222 -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o ‘User=“ec2-user”’ -o ConnectTimeout=10 -o ControlPath=/tmp/awx_1042479_szxroolb/cp/f80bf129af xx.3.21.224 ‘/bin/sh -c ‘"’“‘chmod u+x /home/ec2-user/.ansible/tmp/ansible-tmp-1638783828.3375993-1054-195071821294354/ /home/ec2-user/.ansible/tmp/ansible-tmp-1638783828.3375993-1054-195071821294354/AnsiballZ_command.py && sleep 0’”’"’’
<xx.3.21.224> (0, b’‘, b’‘)
<xx.3.21.224> ESTABLISH SSH CONNECTION FOR USER: ec2-user
<xx.3.21.224> SSH: EXEC ssh -C -o ControlMaster=auto -o ControlPersist=60s -o PreferredAuthentications=publickey -o StrictHostKeyChecking=no -o Port=2222 -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o ‘User=“ec2-user”’ -o ConnectTimeout=10 -o ControlPath=/tmp/awx_1042479_szxroolb/cp/f80bf129af -tt xx.3.21.224 ‘/bin/sh -c ‘"’“'sudo -H -S -n -u root /bin/sh -c '”’"’“'”‘"’“'”‘“‘echo BECOME-SUCCESS-oojnlxxkwnsxnophnkjearkdnewytmln ; /usr/bin/python /home/ec2-user/.ansible/tmp/ansible-tmp-1638783828.3375993-1054-195071821294354/AnsiballZ_command.py’”’“'”‘"’“'”‘"’“’ && sleep 0’”‘"’’
Escalation succeeded
<xx.3.21.224> (0, b’\r\n{“changed”: true, “end”: “2021-12-06 09:44:09.745473”, “stdout”: “”, “cmd”: “python /opt/icapi/ICAPI-DataDog/ic2datadog.py kafka_cluster_config.json &”, “rc”: 0, “start”: “2021-12-06 09:44:08.742850”, “stderr”: “”, “delta”: “0:00:01.002623”, “invocation”: {“module_args”: {“creates”: null, “executable”: null, “_uses_shell”: true, “strip_empty_ends”: true, “_raw_params”: “python /opt/icapi/ICAPI-DataDog/ic2datadog.py kafka_cluster_config.json &”, “removes”: null, “argv”: null, “warn”: true, “chdir”: null, “stdin_add_newline”: true, “stdin”: null}}}\r\n’, b’Shared connection to xx.3.21.224 closed.\r\n’)
<xx.3.21.224> ESTABLISH SSH CONNECTION FOR USER: ec2-user
<xx.3.21.224> SSH: EXEC ssh -C -o ControlMaster=auto -o ControlPersist=60s -o PreferredAuthentications=publickey -o StrictHostKeyChecking=no -o Port=2222 -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o ‘User=“ec2-user”’ -o ConnectTimeout=10 -o ControlPath=/tmp/awx_1042479_szxroolb/cp/f80bf129af xx.3.21.224 ‘/bin/sh -c ‘"’“‘rm -f -r /home/ec2-user/.ansible/tmp/ansible-tmp-1638783828.3375993-1054-195071821294354/ > /dev/null 2>&1 && sleep 0’”’"‘’
<xx.3.21.224> (0, b’‘, b’')
changed: [xx.3.21.224] => {
“changed”: true,
“cmd”: “python /opt/icapi/ICAPI-DataDog/ic2datadog.py kafka_cluster_config.json &”,
“delta”: “0:00:01.002623”,
“end”: “2021-12-06 09:44:09.745473”,
“invocation”: {
“module_args”: {
“_raw_params”: “python /opt/icapi/ICAPI-DataDog/ic2datadog.py kafka_cluster_config.json &”,
“_uses_shell”: true,
“argv”: null,
“chdir”: null,
“creates”: null,
“executable”: null,
“removes”: null,
“stdin”: null,
“stdin_add_newline”: true,
“strip_empty_ends”: true,
“warn”: true
}
},
“rc”: 0,
“start”: “2021-12-06 09:44:08.742850”,
“stderr”: “”…