Iam using Ansible 2.10 with python 3 in WSL linux. In ansible.cfg file, i set global timeout value as 180.
i also set much higher ansible_command_timeout value for certain tasks. However these tasks end in error as ansible shows that command timeout of 180 secs happened. So for some reason, ansible is not considering the TASK specific timeout i set.
I removed the global timeoue value in ansible.cfg still command times out after default command timeout of 30 secs.
Then i created a ansible.cfg and hosts file in the scripts folder and added timeout value but didn’t help either.
Then i switched connction between network_cli and local and also modified command timeout syntax accordingly but didn’t help.
ru7nning script with -vvvv didn’t give any addl insight.
This issue started only recently. So I am suspecting this may have been caused due to the upgrade i did from ansible 2.9 with python 2 to ansible 2.10 with python 3 along with pip3 and other necessry installations as a module required ansible 2.10. Also my colleague using ansible 2.9 doesn’t face this issue. Though i can’t be sure. Anyone experienced this kind of issue or can come up with any workaround? i have massive list of device to copy image and upgrade this weekend
Not an actual answer but some hints for the future
Hi,
Iam using Ansible 2.10 with python 3 in WSL linux. In ansible.cfg file, i set global timeout value as 180.
i also set much higher ansible_command_timeout value for certain tasks. However these tasks end in error as ansible shows that command timeout of 180 secs happened. So for some reason, ansible is not considering the TASK specific timeout i set.
I removed the global timeoue value in ansible.cfg still command times out after default command timeout of 30 secs.
Then i created a ansible.cfg and hosts file in the scripts folder and added timeout value but didn’t help either.
Then i switched connction between network_cli and local and also modified command timeout syntax accordingly but didn’t help.
ru7nning script with -vvvv didn’t give any addl insight.
This issue started only recently. So I am suspecting this may have been caused due to the upgrade i did from ansible 2.9 with python 2 to ansible 2.10 with python 3 along with pip3 and other necessry installations as a module required ansible 2.10. Also my colleague using ansible 2.9 doesn’t face this issue. Though i can’t be sure. Anyone experienced this kind of issue or can come up with any workaround? i have massive list of device to copy image and upgrade this weekend
ANSIBLE.CFG CONFIG:
[defaults]
transport = paramiko
host_key_checking = False
timeout = 5
inventory = /etc/ansible/hosts
gathering = smart
fact_caching = jsonfile
fact_caching_connection = /tmp/facts_cache
fact_caching_timeout = 7200
[persistent_connection]
command_timeout = 180
SCRIPT:
This looks to be the playbook. Please call it as such. “Script” is ambiguous and hence confusing.
I assumed script and playbook were synonymous with each other. I ran playbook using the command ansible-playbook sample.yaml. Again, i didn’t mention it because i assumed this is the only way to run (unless ad hoc command is used), so i didn’t think it was important enough to mention.
The more testing i do, the more it appears like issue may be with ansible 2.10.8 (with python 3.9.2) or maybe the fact that iam using ansible on WSL (windows subsystem for linux) debian linux.
I have implemented an workaround in which i have modified ansible_comamnd_timeout in ansible.cfg file to 36000 seconds. This is the only way i can make the script to complete. Downside is that if ansible gets stuck in any task, it may be stuck there for several hours unless someone notices.
Please let me know if someone has encountered similar issue or there is a documented bug that indicates this.