first commit
This commit is contained in:
commit
e433ff8833
10
inhouse/inhouse.yml
Normal file
10
inhouse/inhouse.yml
Normal file
@ -0,0 +1,10 @@
|
||||
proxmox:
|
||||
hosts:
|
||||
172.22.0.3:
|
||||
172.22.0.10:
|
||||
zima:
|
||||
hosts:
|
||||
172.22.0.2:60000:
|
||||
172.22.0.5:
|
||||
172.22.0.6:
|
||||
172.22.0.7:
|
||||
29
inhouse/upgrade.yml
Normal file
29
inhouse/upgrade.yml
Normal file
@ -0,0 +1,29 @@
|
||||
---
|
||||
- name: Update Debian/Ubuntu system and reboot
|
||||
hosts: all # This will target all hosts in your inventory
|
||||
become: true # Use sudo privileges
|
||||
|
||||
tasks:
|
||||
- name: Update apt cache
|
||||
apt:
|
||||
update_cache: yes
|
||||
cache_valid_time: 3600 # Consider cache valid for 1 hour
|
||||
|
||||
- name: Upgrade all packages
|
||||
apt:
|
||||
upgrade: dist
|
||||
force_apt_get: yes # Use apt-get instead of aptitude
|
||||
|
||||
- name: Check if reboot is required
|
||||
register: reboot_required
|
||||
stat:
|
||||
path: /var/run/reboot-required
|
||||
|
||||
- name: Reboot system if required
|
||||
reboot:
|
||||
msg: "Rebooting system due to package updates"
|
||||
connect_timeout: 5
|
||||
reboot_timeout: 300
|
||||
pre_reboot_delay: 0
|
||||
post_reboot_delay: 30
|
||||
when: reboot_required.stat.exists
|
||||
Loading…
Reference in New Issue
Block a user