it-praktyk.Reboot-And-Wait
Reboot and Wait
This is an Ansible role designed to reboot Linux systems that use systemd for managing services.
By using this role, you can prevent errors like:
fatal: [10.0.15.50]: UNREACHABLE! => {"changed": false, "msg": "Failed to connect to the host via ssh: Shared connection to 10.0.15.50 closed.\r\n", "unreachable": true}
Requirements
No special requirements for this role.
Role Variables
reboot_delay: Number of seconds to wait before rebooting.
reboot_delay = 10
return_port: Port to check for server availability.
return_port = 22
return_delay: Time in seconds to wait before the first connection attempt.
return_delay = 40
return_timeout: Time in seconds for how long connection attempts will be made.
return_timeout = 300
return_connect_timeout: Time in seconds for how long the connection probe will keep trying.
return_connect_timeout = 20
The variables that start with 'return_' are used by the wait_for Ansible module. Please refer to the module's documentation for more details.
Dependencies
No external dependencies are needed for this role.
Example Playbook
- hosts: servers
roles:
- { role: it-praktyk.reboot-and-wait }
License
Copyright (c) 2016 Wojciech Sciesinski
This role is licensed under The MIT License (MIT)
Full license text: MIT License
Author Information
- Author: Wojciech Sciesinski, wojciech[at]sciesinski[dot]net
- Keywords: Ansible, systemd, reboot
- Credits: Thanks to Marcin Skarbek for the answer on Stack Overflow
TODO
A role intended to reboot Linux based system with systemd as a system and service manager.
ansible-galaxy install it-praktyk.Reboot-And-Wait