repo migration

This commit is contained in:
2025-05-13 08:39:58 -04:00
commit a596274ca6
9 changed files with 184 additions and 0 deletions
+54
View File
@@ -0,0 +1,54 @@
---
- hosts: qemuhosts
tasks:
- name: Update all installed packages using YUM module
yum:
name: '*'
state: latest
update_cache: yes
update_only: yes
register: yum_update_status
- name: Remove packates not needed anymore
yum:
autoremove: yes
- name: Reboot when packages were updated
reboot:
when: yum_update_status.changed
- hosts: ctxhosts
tasks:
- name: Update all installed packages using APT module
apt:
name: '*'
state: latest
update_cache: yes
only_upgrade: yes
register: apt_update_status
- name: Remove packages not needed anymore
apt:
autoremove: yes
- name: Reboot when packages were updated
reboot:
post_reboot_delay: 60
when: apt_update_status.changed
- hosts: ipkg
tasks:
- name: Update the Packages installed on Diskstation
command: /opt/bin/ipkg update && /opt/bin/ipkg upgrade
- hosts: windowshosts
tasks:
- name: Install all updates and reboot as many times as needed
ansible.windows.win_updates:
category_names: '*'
reboot: yes
# Optionally, you can increase the reboot_timeout to survive long updates during reboot
- name: Ensure we wait long enough for the updates to be applied during reboot
ansible.windows.win_updates:
reboot: yes
reboot_timeout: 3600