Initial Lab Setup
This commit is contained in:
@@ -0,0 +1,22 @@
|
||||
---
|
||||
- name: Update and upgrade apt packages
|
||||
become: true
|
||||
ansible.builtin.apt:
|
||||
update_cache: yes
|
||||
upgrade: dist
|
||||
autoremove: yes
|
||||
purge: yes
|
||||
tags: [maintenance, upgrade]
|
||||
|
||||
- name: Check if a reboot is required
|
||||
become: true
|
||||
ansible.builtin.stat:
|
||||
path: /var/run/reboot-required
|
||||
register: reboot_required_file
|
||||
tags: [maintenance]
|
||||
|
||||
- name: Notify about pending reboot
|
||||
ansible.builtin.debug:
|
||||
msg: "Host {{ inventory_hostname }} requires a reboot."
|
||||
when: reboot_required_file.stat.exists
|
||||
tags: [maintenance]
|
||||
Reference in New Issue
Block a user