Coder Social home page Coder Social logo

ansible-role-scheduled-reboot's Introduction

scheduled-reboot

A simple wrapper role for the scheduled-reboot tool.

Scheduled-reboot provides a method to control scheduled rebooting of systems that can optionally:

  • Run package upgrades immediately prior to shutdown
  • Run pre-reboot scripts
  • Run recovery scripts in response to any pre-reboot task failures
  • Run post-reboot scripts
  • Log everything
  • Email when problems are encountered

Requirements

  • Ansible 2+
  • scheduled-reboot package. You must host this yourself, it's not on a public PPA

Role Variables

Note: Some variables are mandatory and should be set in group_vars. Other vars will simply no-op if unset.

Reboot schedule

Set the system reboot schedule time, in cron notation. Default: unset

reboot_schedule: '50 5 * * *'

Mail-to addresses

A space-separated list of recipients to send email to when problems occur. Default: 'root'

scheduled_reboot_mailto: root [email protected]

Email when scheduled-reboot is disabled

Send a notification email at script exection time when scheduled-reboot is disabled. Mandatory. Default: unset

scheduled_reboot_email_when_disabled: true

Cron job state

Ensure scheduled-reboot cron job is present or absent. Default: absent

scheduled_reboot_cronjob_state: absent

Scheduled-reboot package state

Package state for 'scheduled-reboot' package. [absent, latest, present] Default: present

scheduled_reboot_package_state: present

Post-reboot oneshot service enabled

Should post-reboot systemd one-shot service be enabled? [true|false] Default: true Controls the one-shot service that runs post-boot user scripts.

scheduled_reboot_post_reboot_service_enabled: true

Package Upgrade

Run package upgrades immediately prior to reboot [true|false] Default: false

scheduled_reboot_upgrade_at_shutdown: false

Example Playbook

- hosts: servers
  roles:
     - scheduled-reboot
  vars:
    reboot_schedule: '50 5 * * *'
    scheduled_reboot_cronjob_state: present
    scheduled_reboot_email_when_disabled: true
    scheduled_reboot_mailto: root [email protected]
    scheduled_reboot_package_state: present
    scheduled_reboot_post_reboot_service_enabled: true
    scheduled_reboot_scheduled_reboots_disabled: false
    scheduled_reboot_upgrade_at_shutdown: true

License

MIT

Author Information

This role was created in 2021 by Kodiak Firesmith, an ops guy at Woods Hole Oceanographic Institution. Aside from GitHub, I'm most active on LinkedIn.

ansible-role-scheduled-reboot's People

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.