No puede seleccionar más de 25 temas Los temas deben comenzar con una letra o número, pueden incluir guiones ('-') y pueden tener hasta 35 caracteres de largo.

hace 7 años
hace 7 años
hace 7 años
hace 7 años
hace 7 años
hace 7 años
hace 7 años
hace 7 años
hace 7 años
hace 5 años
hace 7 años
hace 5 años
hace 7 años
hace 7 años
hace 7 años
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. ---
  2. - name: reboot
  3. command:
  4. systemd-run --on-active={{reboot_command_after_seconds}}
  5. shutdown -r now "Reboot triggered by Ansible script"
  6. #async: 1
  7. #poll: 0
  8. #ignore_errors: true
  9. when: reboot_command
  10. - name: wait for ssh port to be closed
  11. wait_for:
  12. host: "{{ ansible_host | default(inventory_hostname) }}"
  13. port: 22
  14. search_regex: OpenSSH
  15. timeout: "{{ reboot_wait_for_ssh_close_timeout_seconds }}"
  16. state: absent
  17. vars:
  18. ansible_connection: local
  19. register: _reboot_wait_for_ssh_port_closed
  20. - name: note the shutdown time
  21. set_fact:
  22. _reboot_shutdown_timestamp: "{{ _current_timestamp }}"
  23. - name: pause to let host reboot
  24. pause:
  25. seconds: "{{ reboot_pause_seconds }}"
  26. register: _reboot_pause
  27. - name: wait for ssh port to be open again
  28. wait_for:
  29. host: "{{ ansible_host | default(inventory_hostname) }}"
  30. port: 22
  31. search_regex: OpenSSH
  32. timeout: "{{ reboot_wait_for_ssh_open_timeout_seconds }}"
  33. state: present
  34. vars:
  35. ansible_connection: local
  36. register: _reboot_wait_for_ssh_port_open
  37. - include_role:
  38. name: ssh_host_key
  39. - name: try to connect to ssh
  40. setup:
  41. - name: check uptime for successful reboot
  42. set_fact:
  43. reboot_uptime: "{{ ansible_uptime_seconds }}"
  44. failed_when: ansible_uptime_seconds > reboot_uptime_max_seconds