- name: Simulate long running op (15 sec),wait for up to 30 sec,poll every 5sec
shell: "{{ execute_path_nityo }}/execute.sh"
async: 30
poll: 5
If you want to set a longer timeout limit for a certain task in your playbook, use async with poll set to a positive value. Ansible will still block the next task in your playbook, waiting until the async task either completes, fails or times out. However, the task will only time out if it exceeds the timeout limit you set with the async parameter.
- name: Execute the script
shell: "/tmp/script.sh 60" # Run for 60 seconds
async: 120 # Maximum allowed time in Seconds
poll: 10 # Polling Interval in Seconds
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…