mirror of
https://github.com/JamesTurland/JimsGarage.git
synced 2025-08-15 17:52:24 +00:00
update
This commit is contained in:
parent
57cdb3e71d
commit
86447d24f0
24
Ansible/Playbooks/Update/update-builtin.yml
Normal file
24
Ansible/Playbooks/Update/update-builtin.yml
Normal file
@ -0,0 +1,24 @@
|
|||||||
|
---
|
||||||
|
- hosts: all
|
||||||
|
gather_facts: yes
|
||||||
|
become: yes
|
||||||
|
|
||||||
|
tasks:
|
||||||
|
- name: Perform a distro upgrade
|
||||||
|
ansible.builtin.apt:
|
||||||
|
upgrade: dist
|
||||||
|
update_cache: yes
|
||||||
|
|
||||||
|
- name: Check if a reboot is required
|
||||||
|
ansible.builtin.stat:
|
||||||
|
path: /var/run/reboot-required
|
||||||
|
get_checksum: no
|
||||||
|
register: reboot_required_file
|
||||||
|
|
||||||
|
- name: Reboot the server (if necessary)
|
||||||
|
ansible.builtin.reboot:
|
||||||
|
when: reboot_required_file.stat.exists == true
|
||||||
|
|
||||||
|
- name: Remove dependencies that are no longer needed
|
||||||
|
ansible.builtin.apt:
|
||||||
|
autoremove: yes
|
Loading…
x
Reference in New Issue
Block a user