cjsteel.reboot

Reboot

The purpose of this role is to restart your system.

Example Playbook

Here's a simple example of how to use this role, taken from molecule/resources/playbook.yml. It's tested with each update.

---
- name: Converge
  hosts: all
  become: yes
  gather_facts: yes

  roles:
    - robertdebock.reboot

Before you run this, you might need to prepare your machine. Use this playbook to set everything up for the role to work:

---
- name: Prepare
  hosts: all
  gather_facts: no
  become: yes

  roles:
    - robertdebock.bootstrap

You can find a detailed explanation and example on how to use these roles.

Role Variables

These settings are found in defaults/main.yml:

---
# Defaults for reboot

# Some systems can check if a reboot is necessary. 
# Set this to always reboot if needed.
reboot_always: no

# Time to wait before performing a reboot.
reboot_delay: 4

# Seconds to wait before checking if the machine is back up.
reboot_up_delay: 8

# You can specify a message for the reboot, which helps with tracking changes.
reboot_message: "Ansible role robertdebock.reboot initiated a reboot."

Requirements

  • Internet access to download necessary packages.
  • A recent version of Ansible (Tests are done on the latest releases).

Use the command ansible-galaxy install -r requirements.yml to install the required roles:

---
- robertdebock.bootstrap

Context

This role works with many other compatible roles. Check out the documentation of these roles for more information.

dependencies

Compatibility

This role has been tested on the following container images:

Container Tag Allow Failures
alpine latest no
alpine edge yes
debian unstable yes
debian latest no
centos 7 no
centos latest no
fedora latest no
fedora rawhide yes
opensuse latest no
ubuntu latest no

This role is compatible with these Ansible versions:

Exceptions

Some variations of the build matrix do not work for these reasons:

Variation Reason
archlinux/base New-style module did not handle its exit

Testing

Unit tests are run on every update and release.

If you encounter any issues, please report them on GitHub.

Testing is done using Tox and Molecule:

Tox tests multiple versions of Ansible, while Molecule tests various distributions.

To test using the defaults (latest Fedora image):

molecule test

# Or choose a specific image:
image=ubuntu molecule test
# Or specify both image and tag:
image="debian" tag="stable" tox

You can also test multiple versions of Ansible and select specific images with Tox:

tox

# To run using CentOS:
image="centos" tox
# Or customize more:
image="debian" tag="stable" tox

Modules

This role utilizes the following modules:

---
- command
- meta
- package
- pause
- setup
- shell
- stat
- wait_for_connection

License

Apache-2.0

Author Information

Robert de Bock

Informazioni sul progetto

The purpose of this role is to reboot your system.

Installa
ansible-galaxy install cjsteel.reboot
Licenza
apache-2.0
Download
182
Proprietario
These repositories are under heavy development. Some less dynamic projects are available at https://github.com/csteel