From 0502c4f766a4d8551ad9580df25c3480608f71ea242b9ee0647fe12ebeee5ba2 Mon Sep 17 00:00:00 2001 From: Heath Petersen Date: Fri, 10 Jul 2026 17:06:23 -0500 Subject: [PATCH] my first playbooks! --- scraps/cheats.txt | 5 +++++ scraps/clean_up_software.yml | 19 +++++++++++++++++++ scraps/update_software.yml | 17 +++++++++++++++++ 3 files changed, 41 insertions(+) create mode 100644 scraps/cheats.txt create mode 100644 scraps/clean_up_software.yml create mode 100644 scraps/update_software.yml diff --git a/scraps/cheats.txt b/scraps/cheats.txt new file mode 100644 index 0000000..b424e0c --- /dev/null +++ b/scraps/cheats.txt @@ -0,0 +1,5 @@ +$ ansible-playbook --limit iris.heath.hpetersenfamily.com --list-hosts scraps/update_software.yml +$ ansible-playbook --limit iris.heath.hpetersenfamily.com --syntax-check scraps/update_software.yml +$ ansible-inventory --list + + diff --git a/scraps/clean_up_software.yml b/scraps/clean_up_software.yml new file mode 100644 index 0000000..cf05575 --- /dev/null +++ b/scraps/clean_up_software.yml @@ -0,0 +1,19 @@ +--- + +# CHANGEME - handle multiple software packaging systems (apt, yum, dnf, rpm, etc.) + +- name: Update software + hosts: all + become: yes + + post_tasks: + + - name: Remove packages installed as dependencies that are no longer required and purge their configuration files + ansible.builtin.apt: + autoremove: yes + purge: true + + - name: Remove old downloaded packages + ansible.builtin.apt: + clean: yes + diff --git a/scraps/update_software.yml b/scraps/update_software.yml new file mode 100644 index 0000000..f40f845 --- /dev/null +++ b/scraps/update_software.yml @@ -0,0 +1,17 @@ +--- + +# CHANGEME - handle multiple software packaging systems (apt, yum, dnf, rpm, etc.) + +- name: Update software + hosts: all + become: yes + + pre_tasks: + + - name: Update package repositories + ansible.builtin.apt: + update_cache: yes + + - name: Upgrade all packages + ansible.builtin.apt: + upgrade: full