This Ansible Collection provides playbooks for managing Ubuntu systems, including package upgrades, service restarts, and system reboots. These playbooks are designed to be modular and reusable, leveraging Ansible roles for specific tasks.
- Ansible Core 2.10 or later.
- Target hosts must be Ubuntu systems.
You can install this collection from Ansible Galaxy:
ansible-galaxy collection install bartmichu.ubuntu_maintenanceThis collection includes the following playbooks:
-
account_shutdown.yamlCreates a dedicated, restricted user account designed solely for initiating system shutdowns via SSH. -
bootstrap_ansible_host.yamlPerforms automated bootstrapping of an Ansible-managed host. -
check_state.yamlChecks the state of an Ubuntu system, including available package upgrades (security and regular), services requiring a restart, and whether a system reboot is needed. Provides a summary of the findings. (Seedocs/check_state.mdfor more details). -
reboot_conditionally.yamlPerforms a system reboot only when necessary (due to pending updates or service restarts requiring a reboot) and when explicitly allowed via theumc_reboot_allowedvariable. (Seedocs/reboot_conditionally.mdfor more details). -
reboot_unconditionally.yamlPerforms an unconditional system reboot. Use with caution! (Seedocs/reboot_unconditionally.mdfor more details). -
services_restart.yamlRestarts services that require it, using theneedrestartutility. Performs a check before and after attempting the restarts to identify which services were successfully restarted and which still require attention. (Seedocs/services_restart.mdfor more details). -
shutdown_unconditionally.yamlPerforms an unconditional system shutdown. Use with caution! (Seedocs/shutdown_unconditionally.mdfor more details). -
upgrade_all_reboot.yamlUpdates all upgradeable packages (including security updates) and reboots the system if necessary and allowed. (Seedocs/upgrade_all.mdfor more details). -
upgrade_all.yamlUpdates all upgradeable packages (including security updates). Checks for required reboots and service restarts and reports on them. (Seedocs/upgrade_all.mdfor more details). -
upgrade_security.yamlInstalls available security updates. Checks for required reboots and service restarts and reports on them. (Seedocs/upgrade_security.mdfor more details).
See the individual role directories for their respective README.md files for more detailed information.
Several playbooks in this collection use variables. Please refer to the documentation for each playbook for specific variable requirements. A key variable used across many playbooks is umc_reboot_allowed, which controls whether reboots are permitted, as well as umc_services_reboot and umc_services_restart_allowed.
This playbook is licensed under MIT License.