create playbook to apply updates to all managed hosts

This commit is contained in:
2025-08-10 22:29:49 -04:00
parent fa398caeaa
commit 907cfef01b
3 changed files with 34 additions and 2 deletions

View File

@@ -16,10 +16,12 @@
file: path=~/.ssh state=directory mode=700
- debug: var=ansible_os_family
run_once: true
- debug: var=ansible_architecture
run_once: true
- debug: var=ansible_distribution_release
- debug: var=ansible_pkg_mgr
tasks:
- name: ping

View File

@@ -0,0 +1,29 @@
---
# update the managed host machines
- name: updates
hosts: managed
gather_facts: true
vars:
pre_tasks:
roles:
tasks:
- name: print os version
ansible.builtin.debug:
var: ansible_facts["os_family"]
## ansible_pkg_mgr, ansible_os_family, ansible_distribution
- name: update packages
apt:
name: "*"
state: latest
update_cache: yes
cache_valid_time: 3600
when: ansible_pkg_mgr == "apt"
become: true
## TODO: raspberrypi os should be a full-upgrade