How would you use Ansible to patch Linux servers monthly?
AdvancedScenarioAWX, Cloud and Large-Scale Operations
Answer
Situation read → Patch management.
What I'd do →
- hosts: all
serial: "20%"
tasks:
- ansible.builtin.dnf: { name: "*", state: latest, security: true }
register: upd
- ansible.builtin.reboot:
when: upd is changed
Schedule in AWX, patch non-prod a week earlier, and skip hosts in maintenance.
Why → Rings and batches catch issues early.
Interview tip → needs-restarting -r decides if a reboot is really required.
More on AWX, Cloud and Large-Scale Operations
Your company wants a self-service UI for running playbooks with RBAC. What do you propose?BeginnerHow do you run AWX on Kubernetes?BeginnerA job template should prompt for the target limit and a version, with validation.IntermediateYou need provisioning followed by configuration followed by an approval and then deploy.IntermediateA dynamic inventory source in AWX syncs slowly and stale hosts remain.IntermediateYou manage 5,000 servers and a single job takes hours.Advanced