# Unable to update debian header and build essential using Ansible playbook

**URL:** <https://forum.ansible.com/t/unable-to-update-debian-header-and-build-essential-using-ansible-playbook/33554>\
**Category:** Ansible Project\
**Created:** [August 5, 2020, 5:12pm UTC](https://forum.ansible.com/t/unable-to-update-debian-header-and-build-essential-using-ansible-playbook/33554 "2020-08-05T17:12:40Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![abhishek\_verma](https://avatars.discourse-cdn.com/v4/letter/a/258eb7/32.png) [@abhishek\_verma](https://forum.ansible.com/u/abhishek_verma)\
**Post date:** [August 5, 2020, 5:12pm UTC](https://forum.ansible.com/t/unable-to-update-debian-header-and-build-essential-using-ansible-playbook/33554/1 "2020-08-05T17:12:40Z")

</div>

`

- hosts: DEV1  
become: yes  
tasks:
- name: “Update linux headers”  
apt:  
name: “linux-headers-{{ ansible\_kernel }}”  
`

After running this the ansible hangs after fact gathering. Please find the output below:

`  
ansibleuser@debian:~/ansible\_code$ ansible-playbook -vvv playbooks/second-playbook.yaml  
ansible-playbook 2.9.11  
config file = /home/ansibleuser/ansible\_code/ansible.cfg  
configured module search path = [‘/home/ansibleuser/.ansible/plugins/modules’, ‘/usr/share/ansible/plugins/modules’]  
ansible python module location = /usr/local/lib/python3.5/dist-packages/ansible  
executable location = /usr/local/bin/ansible-playbook  
python version = 3.5.3 (default, Jul 9 2020, 13:00:10) [GCC 6.3.0 20170516]  
Using /home/ansibleuser/ansible\_code/ansible.cfg as config file  
host\_list declined parsing /home/ansibleuser/ansible\_code/inventory as it did not pass its verify\_file() method  
script declined parsing /home/ansibleuser/ansible\_code/inventory as it did not pass its verify\_file() method  
auto declined parsing /home/ansibleuser/ansible\_code/inventory as it did not pass its verify\_file() method  
Parsed /home/ansibleuser/ansible\_code/inventory inventory source with ini plugin

PLAYBOOK: second-playbook.yaml \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*  
1 plays in playbooks/second-playbook.yaml

PLAY [DEV1] \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*

TASK [Gathering Facts] \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*  
task path: /home/ansibleuser/ansible\_code/playbooks/second-playbook.yaml:1  
\<192.168.1.153\> ESTABLISH SSH CONNECTION FOR USER: idriveadmin  
\<192.168.1.153\> SSH: EXEC ssh -C -o ControlMaster=auto -o ControlPersist=60s -o Port=1460 -o ‘IdentityFile=“/home/ansibleuser/ansibleuserkey”’ -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o ‘User=“idriveadmin”’ -o ConnectTimeout=10 -o ControlPath=/home/ansibleuser/.ansible/cp/a5ab6003fd 192.168.1.153 ‘/bin/sh -c ‘"’“‘echo ~idriveadmin && sleep 0’”’“‘’  
\<192.168.1.153\> (0, b’/home/idriveadmin\n’, b’')  
\<192.168.1.153\> ESTABLISH SSH CONNECTION FOR USER: idriveadmin  
\<192.168.1.153\> SSH: EXEC ssh -C -o ControlMaster=auto -o ControlPersist=60s -o Port=1460 -o 'IdentityFile=”/home/ansibleuser/ansibleuserkey"’ -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o ‘User=“idriveadmin”’ -o ConnectTimeout=10 -o ControlPath=/home/ansibleuser/.ansible/cp/a5ab6003fd 192.168.1.153 ‘/bin/sh -c ‘"’"’( umask 77 && mkdir -p “`echo /home/idriveadmin/.ansible/tmp`”&& mkdir /home/idriveadmin/.ansible/tmp/ansible-tmp-1596646753.1827192-28335-58868948093896 && echo ansible-tmp-1596646753.1827192-28335-58868948093896=“`echo /home/idriveadmin/.ansible/tmp/ansible-tmp-1596646753.1827192-28335-58868948093896`” ) && sleep 0’“'”‘’  
\<192.168.1.153\> (0, b’ansible-tmp-1596646753.1827192-28335-58868948093896=/home/idriveadmin/.ansible/tmp/ansible-tmp-1596646753.1827192-28335-58868948093896\n’, b’‘)  
 Attempting python interpreter discovery  
\<192.168.1.153\> ESTABLISH SSH CONNECTION FOR USER: idriveadmin  
\<192.168.1.153\> SSH: EXEC ssh -C -o ControlMaster=auto -o ControlPersist=60s -o Port=1460 -o ‘IdentityFile=“/home/ansibleuser/ansibleuserkey”’ -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o ‘User=“idriveadmin”’ -o ConnectTimeout=10 -o ControlPath=/home/ansibleuser/.ansible/cp/a5ab6003fd 192.168.1.153 ‘/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’”‘"’’  
\<192.168.1.153\> (0, b’PLATFORM\nLinux\nFOUND\n/usr/bin/python\n/usr/local/bin/python3.6\n/usr/bin/python3.5\n/usr/bin/python2.7\n/usr/bin/python3\n/usr/bin/python\nENDFOUND\n’, b’‘)  
\<192.168.1.153\> ESTABLISH SSH CONNECTION FOR USER: idriveadmin  
\<192.168.1.153\> SSH: EXEC ssh -C -o ControlMaster=auto -o ControlPersist=60s -o Port=1460 -o ‘IdentityFile=“/home/ansibleuser/ansibleuserkey”’ -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o ‘User=“idriveadmin”’ -o ConnectTimeout=10 -o ControlPath=/home/ansibleuser/.ansible/cp/a5ab6003fd 192.168.1.153 ‘/bin/sh -c ‘"’"’/usr/bin/python && sleep 0’“'”‘’  
\<192.168.1.153\> (0, b’{“osrelease\_content”: “PRETTY\_NAME=\“Debian GNU/Linux 9 (stretch)\”\nNAME=\“Debian GNU/Linux\”\nVERSION\_ID=\“9\”\nVERSION=\“9 (stretch)\”\nVERSION\_CODENAME=stretch\nID=debian\nHOME\_URL=\“[https://www.debian.org/\\“\\nSUPPORT\_URL=\\“https://www.debian.org/support\\”\\nBUG\_REPORT\_URL=\\“https://bugs.debian.org/\\”\\n”](https://www.debian.org/%5C%5C%22%5C%5CnSUPPORT_URL=%5C%5C%22https://www.debian.org/support%5C%5C%22%5C%5CnBUG_REPORT_URL=%5C%5C%22https://bugs.debian.org/%5C%5C%22%5C%5Cn%22), “platform\_dist\_result”: [“debian”, “9.11”, “”]}\n’, b’')  
 Python interpreter discovery fallback (unsupported Linux distribution: debian)  
Using module file /usr/local/lib/python3.5/dist-packages/ansible/modules/system/setup.py  
\<192.168.1.153\> PUT /home/ansibleuser/.ansible/tmp/ansible-local-28329eia3qjsx/tmpb0q749yy TO /home/idriveadmin/.ansible/tmp/ansible-tmp-1596646753.1827192-28335-58868948093896/AnsiballZ\_setup.py  
\<192.168.1.153\> SSH: EXEC sftp -b - -C -o ControlMaster=auto -o ControlPersist=60s -o Port=1460 -o 'IdentityFile=”/home/ansibleuser/ansibleuserkey”’ -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o ‘User=“idriveadmin”’ -o ConnectTimeout=10 -o ControlPath=/home/ansibleuser/.ansible/cp/a5ab6003fd ‘[192.168.1.153]’  
\<192.168.1.153\> (0, b’sftp\> put /home/ansibleuser/.ansible/tmp/ansible-local-28329eia3qjsx/tmpb0q749yy /home/idriveadmin/.ansible/tmp/ansible-tmp-1596646753.1827192-28335-58868948093896/AnsiballZ\_setup.py\n’, b’‘)  
\<192.168.1.153\> ESTABLISH SSH CONNECTION FOR USER: idriveadmin  
\<192.168.1.153\> SSH: EXEC ssh -C -o ControlMaster=auto -o ControlPersist=60s -o Port=1460 -o ‘IdentityFile=“/home/ansibleuser/ansibleuserkey”’ -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o ‘User=“idriveadmin”’ -o ConnectTimeout=10 -o ControlPath=/home/ansibleuser/.ansible/cp/a5ab6003fd 192.168.1.153 ‘/bin/sh -c ‘"’“‘chmod u+x /home/idriveadmin/.ansible/tmp/ansible-tmp-1596646753.1827192-28335-58868948093896/ /home/idriveadmin/.ansible/tmp/ansible-tmp-1596646753.1827192-28335-58868948093896/AnsiballZ\_setup.py && sleep 0’”’"’’  
\<192.168.1.153\> (0, b’‘, b’‘)  
\<192.168.1.153\> ESTABLISH SSH CONNECTION FOR USER: idriveadmin  
\<192.168.1.153\> SSH: EXEC ssh -C -o ControlMaster=auto -o ControlPersist=60s -o Port=1460 -o ‘IdentityFile=“/home/ansibleuser/ansibleuserkey”’ -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o ‘User=“idriveadmin”’ -o ConnectTimeout=10 -o ControlPath=/home/ansibleuser/.ansible/cp/a5ab6003fd -tt 192.168.1.153 ‘/bin/sh -c ‘"’“'sudo -H -S -n -u root /bin/sh -c '”’"’“'”‘"’“'”‘“‘echo BECOME-SUCCESS-lrghmoionoknwyoynanrcjziykyevqfo ; /usr/bin/python /home/idriveadmin/.ansible/tmp/ansible-tmp-1596646753.1827192-28335-58868948093896/AnsiballZ\_setup.py’”’“'”‘"’“'”‘"’“’ && sleep 0’”‘"’’  
Escalation succeeded

`

But the connection to DEV1 host is fine. Below is the output:

`ansibleuser@debian:~/ansible_code$ ansible DEV1 -m ping [WARNING]: Platform linux on host DEV1 is using the discovered Python interpreter at /usr/bin/python, but future installation of another Python interpreter could change this. See https://docs.ansible.com/ansible/2.9/reference_appendices/interpreter_discovery.html for more information. DEV1 | SUCCESS => { "ansible_facts": { "discovered_interpreter_python": "/usr/bin/python" }, "changed": false, "ping": "pong" }`

Please help in correcting me.

---

<div class="post-metadata">

**Author:** ![jean-yves](https://avatars.discourse-cdn.com/v4/letter/j/a587f6/32.png) [@jean-yves](https://forum.ansible.com/u/jean-yves)\
**Post date:** [August 5, 2020, 8:41pm UTC](https://forum.ansible.com/t/unable-to-update-debian-header-and-build-essential-using-ansible-playbook/33554/2 "2020-08-05T20:41:03Z")

</div>

Hello,

There’s a lock on a fact during the gather fact… There’s probably something which goes wrong on your server you need to fix

You can try to limit the gather fact to see where the problem could be… Explications on how to do it is there :

[https://stackoverflow.com/questions/34485286/how-to-filter-gathering-facts-inside-a-playbook](https://stackoverflow.com/questions/34485286/how-to-filter-gathering-facts-inside-a-playbook)

I’ve had this problem with :

- lvm command not responding on a server for example…

- rpm corrupted database

but there can be others reasons

Regards,

JYL
