Add update_ansible_host.yml playbook

Dedicated playbook for updating the Ansible control node separately
from the bulk update_upgrade.yml which excludes AnsibleHost.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
jeet
2026-03-22 14:19:53 -04:00
parent d2e8cc6e70
commit dc0819bb05
+23
View File
@@ -0,0 +1,23 @@
---
- name: Update and upgrade Ansible host
hosts: AnsibleHost
become: true
gather_facts: true
tasks:
- name: Update and upgrade apt packages
apt:
update_cache: yes
upgrade: safe
when: ansible_os_family == "Debian"
- name: Check if reboot is required
ansible.builtin.stat:
path: /var/run/reboot-required
get_checksum: no
register: reboot_required_file
when: ansible_os_family == "Debian"
- name: Reboot if required
ansible.builtin.reboot:
when: reboot_required_file is defined and reboot_required_file.stat.exists