feat: add Ansible playbook to mask avahi-daemon on all Ubuntu VMs (#28) #39
No reviewers
Labels
No Label
ai-changes-requested
ai-failed
ai-pr-opened
ai-reviewed
ai-reviewing
ai-working
infra-audit
monitoring
operations
proxmox
script
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: cal/claude-home#39
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "issue/28-ansible-playbook-mask-avahi-daemon-across-all-ubun"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Closes #28
Summary
ansible/playbooks/mask-avahi.yml— targets thevms:physicalinventory groups (all 5 Ubuntu QEMU VMs + ubuntu-manticore physical server). Stops, masks, and verifies avahi-daemon is permanently disabled.vm-management/scripts/cloud-init-user-data.yaml— adds avahi masking to theruncmdsection so any future VM provisioned from this template is hardened from first boot.Implementation notes
vms:physicalwhich matches the existing inventory groups on the Ansible controller (LXC 304 at 10.10.0.232) — no inventory changes needed, all Ubuntu VMs are already managed.ignore_errors: trueon the stop task handles hosts where avahi is already stopped or not installed.changed_when: falseon the verify task suppresses false-positive changed status.| trimfilter on the stdout check handles trailing newlines fromsystemctl is-enabled.Usage
Rollback
AI Code Review
Files Reviewed
ansible/playbooks/mask-avahi.yml(added)vm-management/scripts/cloud-init-user-data.yaml(modified)Findings
Correctness
systemctl is-enabled avahi-daemonexits with rc=1 for masked units. Sincefailed_whenis specified, it replaces Ansible's default "fail on non-zero rc" behavior — the task correctly succeeds when stdout ismaskedregardless of exit code. This is intentional and correct.ignore_errors: true: Handles hosts where avahi is already stopped or not installed. Appropriate scope.ignore_errors:systemctl maskcreates a/dev/nullsymlink and works even when the package isn't installed — no guard needed here.|| true: Mirrors theignore_errorspattern correctly for the shell context.Security
Style & Conventions
ansible.builtin.systemd,ansible.builtin.command) — Ansible best practice.changed_when: falseon the verify task correctly suppresses false-positive changed status.| trimfilter on thefailed_whencondition cleanly handles trailing newline fromsystemctl.Suggestions
gather_facts: falseto the play — no facts are used, so skipping fact gathering would shorten the playbook run by a few seconds per host. Minor optimization, not a blocker.Verdict: APPROVED
Clean, correct, and well-documented. The
failed_whenexit-code interaction is the only subtle point and it's handled correctly. The cloud-init update ensures future VMs are hardened from first boot, which is the right place to put this.Automated review by Claude PR Reviewer
Pull request closed