Hello All,
I am running ansible from a MAC 2018, ansible version 2.8.3 and trying to update servers in AWS (Amazon Linux) . I can successfully ping all the servers, and can run my playbook on ALL server BUT on dev_FE and I don’t understand why.Please assist.
`
ansible-playbook -vvv -i inventory --limit=dev_FE main.yml
ansible-playbook 2.8.3
config file = /WALLETHUB/ansible/patch_server/ansible.cfg
configured module search path = [‘/var/root/.ansible/plugins/modules’, ‘/usr/share/ansible/plugins/modules’]
ansible python module location = /usr/local/lib/python3.7/site-packages/ansible
executable location = /usr/local/bin/ansible-playbook
python version = 3.7.4 (default, Jul 9 2019, 18:13:23) [Clang 10.0.1 (clang-1001.0.46.4)]
Using /WALLETHUB/ansible/patch_server/ansible.cfg as config file
host_list declined parsing /WALLETHUB/ansible/patch_server/inventory as it did not pass it’s verify_file() method
script declined parsing /WALLETHUB/ansible/patch_server/inventory as it did not pass it’s verify_file() method
auto declined parsing /WALLETHUB/ansible/patch_server/inventory as it did not pass it’s verify_file() method
Parsed /WALLETHUB/ansible/patch_server/inventory inventory source with ini plugin
PLAYBOOK: main.yml *************************************************************************************************************************************************************************************************************************************************************
1 plays in main.yml
PLAY [wallethub] ***************************************************************************************************************************************************************************************************************************************************************
TASK [Gathering Facts] *********************************************************************************************************************************************************************************************************************************************************
task path: /WALLETHUB/ansible/patch_server/main.yml:2
<3.220.249.184> ESTABLISH SSH CONNECTION FOR USER: andrewm
<3.220.249.184> SSH: EXEC sshpass -d41 ssh -C -o ControlMaster=auto -o ControlPersist=60s -o StrictHostKeyChecking=no -o Port=43045 -o ‘IdentityFile=“/Users/confluencetrades/Desktop/andrewm.pem”’ -o ‘User=“andrewm”’ -o ConnectTimeout=10 -o ControlPath=/private/var/root/.ansible/cp/90ef5f326d 3.220.249.184 ‘/bin/sh -c ‘"’“‘echo ~andrewm && sleep 0’”’“‘’
<3.220.249.184> (0, b’/home/andrewm\n’, b’')
<3.220.249.184> ESTABLISH SSH CONNECTION FOR USER: andrewm
<3.220.249.184> SSH: EXEC sshpass -d41 ssh -C -o ControlMaster=auto -o ControlPersist=60s -o StrictHostKeyChecking=no -o Port=43045 -o 'IdentityFile=”/Users/confluencetrades/Desktop/andrewm.pem"’ -o ‘User=“andrewm”’ -o ConnectTimeout=10 -o ControlPath=/private/var/root/.ansible/cp/90ef5f326d 3.220.249.184 ‘/bin/sh -c ‘"’"’( umask 77 && mkdir -p “echo /home/andrewm/.ansible/tmp/ansible-tmp-1566672582.347262-86980762832587
” && echo ansible-tmp-1566672582.347262-86980762832587=“echo /home/andrewm/.ansible/tmp/ansible-tmp-1566672582.347262-86980762832587
” ) && sleep 0’“'”‘’
<3.220.249.184> (0, b’ansible-tmp-1566672582.347262-86980762832587=/home/andrewm/.ansible/tmp/ansible-tmp-1566672582.347262-86980762832587\n’, b’‘)
<dev_FE> Attempting python interpreter discovery
<3.220.249.184> ESTABLISH SSH CONNECTION FOR USER: andrewm
<3.220.249.184> SSH: EXEC sshpass -d41 ssh -C -o ControlMaster=auto -o ControlPersist=60s -o StrictHostKeyChecking=no -o Port=43045 -o ‘IdentityFile=“/Users/confluencetrades/Desktop/andrewm.pem”’ -o ‘User=“andrewm”’ -o ConnectTimeout=10 -o ControlPath=/private/var/root/.ansible/cp/90ef5f326d 3.220.249.184 ‘/bin/sh -c ‘"’“'echo PLATFORM; uname; echo FOUND; command -v '”’"’“'”‘"’“'”‘"’/usr/bin/python’“'”‘"’“'”‘"’“'”‘; command -v ‘"’"’“'”‘"’“'”‘“‘python3.7’”’“'”‘"’“'”‘"’“'; command -v '”‘"’“'”‘"’“'”‘“‘python3.6’”’“'”‘"’“'”‘"’“'; command -v '”‘"’“'”‘"’“'”‘“‘python3.5’”’“'”‘"’“'”‘"’“'; command -v '”‘"’“'”‘"’“'”‘“‘python2.7’”’“'”‘"’“'”‘"’“'; command -v '”‘"’“'”‘"’“'”‘“‘python2.6’”’“'”‘"’“'”‘"’“'; command -v '”‘"’“'”‘"’“'”‘"’/usr/libexec/platform-python’“'”‘"’“'”‘"’“'”‘; command -v ‘"’"’“'”‘"’“'”‘"’/usr/bin/python3’“'”‘"’“'”‘"’“'”‘; command -v ‘"’"’“'”‘"’“'”‘“‘python’”’“'”‘"’“'”‘"’“‘; echo ENDFOUND && sleep 0’”‘"’’
<3.220.249.184> (0, b’PLATFORM\nLinux\nFOUND\n/usr/bin/python\n/usr/bin/python2.7\n/usr/bin/python2.6\n/usr/bin/python\nENDFOUND\n’, b’‘)
<3.220.249.184> ESTABLISH SSH CONNECTION FOR USER: andrewm
<3.220.249.184> SSH: EXEC sshpass -d41 ssh -C -o ControlMaster=auto -o ControlPersist=60s -o StrictHostKeyChecking=no -o Port=43045 -o ‘IdentityFile=“/Users/confluencetrades/Desktop/andrewm.pem”’ -o ‘User=“andrewm”’ -o ConnectTimeout=10 -o ControlPath=/private/var/root/.ansible/cp/90ef5f326d 3.220.249.184 ‘/bin/sh -c ‘"’"’/usr/bin/python && sleep 0’“'”‘’
<3.220.249.184> (0, b’{“osrelease_content”: “NAME=\“Amazon Linux AMI\”\nVERSION=\“2018.03\”\nID=\“amzn\”\nID_LIKE=\“rhel fedora\”\nVERSION_ID=\“2018.03\”\nPRETTY_NAME=\“Amazon Linux AMI 2018.03\”\nANSI_COLOR=\“0;33\”\nCPE_NAME=\“cpe:/o:amazon:linux:2018.03:ga\”\nHOME_URL=\“http://aws.amazon.com/amazon-linux-ami/\\“\\n”, “platform_dist_result”: [””, “”, “”]}\n’, b’‘)
<dev_FE> Python interpreter discovery fallback (unsupported Linux distribution: amzn)
Using module file /usr/local/lib/python3.7/site-packages/ansible/modules/system/setup.py
<3.220.249.184> PUT /var/root/.ansible/tmp/ansible-local-70345dl6qhmdh/tmpajfkdun5 TO /home/andrewm/.ansible/tmp/ansible-tmp-1566672582.347262-86980762832587/AnsiballZ_setup.py
<3.220.249.184> SSH: EXEC sshpass -d41 sftp -o BatchMode=no -b - -C -o ControlMaster=auto -o ControlPersist=60s -o StrictHostKeyChecking=no -o Port=43045 -o ‘IdentityFile=“/Users/confluencetrades/Desktop/andrewm.pem”’ -o ‘User=“andrewm”’ -o ConnectTimeout=10 -o ControlPath=/private/var/root/.ansible/cp/90ef5f326d ‘[3.220.249.184]’
<3.220.249.184> (0, b’sftp> put /var/root/.ansible/tmp/ansible-local-70345dl6qhmdh/tmpajfkdun5 /home/andrewm/.ansible/tmp/ansible-tmp-1566672582.347262-86980762832587/AnsiballZ_setup.py\n’, b’‘)
<3.220.249.184> ESTABLISH SSH CONNECTION FOR USER: andrewm
<3.220.249.184> SSH: EXEC sshpass -d41 ssh -C -o ControlMaster=auto -o ControlPersist=60s -o StrictHostKeyChecking=no -o Port=43045 -o ‘IdentityFile=“/Users/confluencetrades/Desktop/andrewm.pem”’ -o ‘User=“andrewm”’ -o ConnectTimeout=10 -o ControlPath=/private/var/root/.ansible/cp/90ef5f326d 3.220.249.184 ‘/bin/sh -c ‘"’“‘chmod u+x /home/andrewm/.ansible/tmp/ansible-tmp-1566672582.347262-86980762832587/ /home/andrewm/.ansible/tmp/ansible-tmp-1566672582.347262-86980762832587/AnsiballZ_setup.py && sleep 0’”’"’’
<3.220.249.184> (0, b’‘, b’‘)
<3.220.249.184> ESTABLISH SSH CONNECTION FOR USER: andrewm
<3.220.249.184> SSH: EXEC sshpass -d41 ssh -C -o ControlMaster=auto -o ControlPersist=60s -o StrictHostKeyChecking=no -o Port=43045 -o ‘IdentityFile=“/Users/confluencetrades/Desktop/andrewm.pem”’ -o ‘User=“andrewm”’ -o ConnectTimeout=10 -o ControlPath=/private/var/root/.ansible/cp/90ef5f326d -tt 3.220.249.184 ‘/bin/sh -c ‘"’“'sudo -H -S -p “[sudo via ansible, key=odjslmmymcfjguanwabuzngyvowjxzsy] password:” -u root /bin/sh -c '”’"’“'”‘"’“'”‘“‘echo BECOME-SUCCESS-odjslmmymcfjguanwabuzngyvowjxzsy ; /usr/bin/python /home/andrewm/.ansible/tmp/ansible-tmp-1566672582.347262-86980762832587/AnsiballZ_setup.py’”’“'”‘"’“'”‘"’“’ && sleep 0’”‘"’’
Escalation succeeded
<3.220.249.184> (1, b’\r\n’, b’Shared connection to 3.220.249.184 closed.\r\n’)
<3.220.249.184> Failed to connect to the host via ssh: Shared connection to 3.220.249.184 closed.
<3.220.249.184> ESTABLISH SSH CONNECTION FOR USER: andrewm
<3.220.249.184> SSH: EXEC sshpass -d41 ssh -C -o ControlMaster=auto -o ControlPersist=60s -o StrictHostKeyChecking=no -o Port=43045 -o ‘IdentityFile=“/Users/confluencetrades/Desktop/andrewm.pem”’ -o ‘User=“andrewm”’ -o ConnectTimeout=10 -o ControlPath=/private/var/root/.ansible/cp/90ef5f326d 3.220.249.184 ‘/bin/sh -c ‘"’“‘rm -f -r /home/andrewm/.ansible/tmp/ansible-tmp-1566672582.347262-86980762832587/ > /dev/null 2>&1 && sleep 0’”’"‘’
<3.220.249.184> (0, b’‘, b’')
fatal: [dev_FE]: FAILED! => {
“ansible_facts”: {},
“changed”: false,
“failed_modules”: {
“setup”: {
“ansible_facts”: {
“discovered_interpreter_python”: “/usr/bin/python”
},
“failed”: true,
“module_stderr”: “Shared connection to 3.220.249.184 closed.\r\n”,
“module_stdout”: “\r\n”,
“msg”: “MODULE FAILURE\nSee stdout/stderr for the exact error”,
“rc”: 1
}
},
“msg”: “The following modules failed to execute: setup\n”
}
PLAY RECAP *********************************************************************************************************************************************************************************************************************************************************************
dev_FE : ok=0 changed=0 unreachable=0 failed=1 skipped=0 rescued=0 ignored=0
`
`
TASK [Ping host] ***************************************************************************************************************************************************************************************************************************************************************
ok: [dev_FE]
`