Monday, January 14, 2019

Pause in ansible playbook waiting for user intervention



How to use sleep in playbook ?

---
- hosts: webservers
  tasks:
  - name: install tftp
    yum: pkg=tftp state=installed
    failed_when: False
  - pause: minutes=5


--
- pause: minutes=5

--

It shows the option
Pausing for 300 seconds
(ctrl+C then 'C' = continue early, ctrl+C then 'A' = abort)


So, C to continue early and A to abort. 

--

This can be used for ansible debugging.
We can exit a playbook after a (debugging) role.

No comments:

Post a Comment