CICD-258 · Operating system patching
Encyclopedia · Ansible and configuration management · All snippets
Previous · CICD-257 · Next · CICD-259
1. Where it fits
- Placement playbooks/security.yml.
- Prerequisites controller with reviewed inventory, pinned Ansible collections and a non-production target.
- Platforms local-lab.
2. Copy the snippet
yaml
- hosts: debian_canary
become: true
serial: 1
tasks:
- ansible.builtin.command: unattended-upgrade --dry-run
changed_when: false3. How it works
The Ansible play targets the named canary group and runs an unattended-upgrades dry run. changed_when avoids claiming a host change during this planning check.
4. Verify the result
Verify Debian unattended-upgrades and approved origins before removing --dry-run during the patch window.
Validation syntax-validated (YAML parse). Status definitions.