| 12345678910111213141516171819 |
- ---
- - name: get uptime in min
- shell: "echo $(awk '{print $1}' /proc/uptime) / 60 | bc"
- register: uptime
-
- - name: Reboot server
- shell: "sleep 5 && /sbin/reboot"
- async: 1
- poll: 0
- become: true
- when: uptime > 30
- - name: Wait for the reboot to complete
- wait_for_connection:
- connect_timeout: 20
- sleep: 5
- delay: 5
- timeout: 300
- when: uptime > 30
|