Why updates deserve their own playbook
Update automation should not disappear inside a baseline role. Updates carry different risk: repositories change, reboots may be required, services must come back and maintenance windows must not be exceeded accidentally.
This part deliberately stays generic. It is not about SUSE Multi-Linux Manager, FreeIPA or Proxmox, but about a reusable Ansible pattern for Linux updates. Specialist cases belong in their own series.
Target design
Limit the target group before changing packages.
Prepare changes with check mode.
Process hosts in small batches.
Detect or trigger reboots deliberately.
Verify connectivity, services and baseline state after reboot.
Inventory groups for maintenance windows
all:children:linux:children:maintenance_window_a:hosts:sles16-client01.example.test:maintenance_window_b:hosts:rocky10-client01.example.test:
Playbook with batch processing
# playbooks/linux-update.yaml- name: Patch Linux systems in controlled batcheshosts: linuxbecome: truegather_facts: trueserial: 2max_fail_percentage: 20pre_tasks:- name: Confirm selected hostsansible.builtin.debug:msg: "Updating {{ inventory_hostname }} in {{ ansible_play_hosts_all | length }} selected hosts"tasks:- name: Refresh package metadata and install available updatesansible.builtin.package:name: '*'state: latest- name: Reboot host when maintenance window allows itansible.builtin.reboot:reboot_timeout: 900test_command: whoamiwhen: linux_updates_allow_reboot | default(false)post_tasks:- name: Verify host is reachable after updateansible.builtin.ping:
Variables instead of spontaneous decisions
# inventories/lab/group_vars/maintenance_window_a.yamllinux_updates_allow_reboot: truelinux_updates_expected_services:- sshd- chronyd
Service validation after update
- name: Verify expected services are runningansible.builtin.service_facts:- name: Assert expected services are activeansible.builtin.assert:that:- ansible_facts.services[item + '.service'].state == 'running'fail_msg: "Expected service {{ item }} is not running"loop: "{{ linux_updates_expected_services | default([]) }}"
Acceptance run
ansible-playbook -i inventories/lab/hosts.yaml playbooks/linux-update.yaml --syntax-checkansible-playbook -i inventories/lab/hosts.yaml playbooks/linux-update.yaml --limit maintenance_window_a --check --diffansible-playbook -i inventories/lab/hosts.yaml playbooks/linux-update.yaml --limit maintenance_window_aansible-playbook -i inventories/lab/hosts.yaml playbooks/linux-update.yaml --limit maintenance_window_a --check --diff
Acceptance table
Limits
This pattern does not replace central patch management or package approval. It describes the technical workflow that can later be connected to SUSE Multi-Linux Manager, repositories, change management or CI/CD.




