Ansible - pause module (sleep)

If you are not familiar with modules, check out Ansible - Getting Started with Modules.

Both the pause module and delay parameter are used to create a pause or delay during task execution.

In this example, a 5 second pause is made after invoking the shell module.

---
- hosts: all
  tasks:
    - name: kill pid 12345
      shell: kill -9 12345

    - name: 5 second pause
      pause:
        seconds: 5
...

 

Something like this should be returned.

PLAY [all]

TASK [kill pid 12345]
changed: [server1.example.com]
changed: [server2.example.com]
changed: [server3.example.com]

TASK [3 second pause]
Pausing for 3 seconds
(ctrl+C then 'C' = continue early, ctrl+C then 'A' = abort)

PLAY RECAP
server1.example.com   : ok=2  changed=1  unreachable=0  failed=0
server2.example.com   : ok=2  changed=1  unreachable=0  failed=0
server3.example.com   : ok=2  changed=1  unreachable=0  failed=0
 

 



Add a Comment




We will never share your name or email with anyone. Enter your email if you would like to be notified when we respond to your comment.





Please enter 577e0 in the box below so that we can be sure you are a human.




Comments

Web design by yours truely - me, myself, and I   |   jeremy.canfield@freekb.net   |