From d483f5ed7281106c78cbb70884a0d385ab3356ae Mon Sep 17 00:00:00 2001 From: shockrah Date: Tue, 5 Nov 2024 16:08:09 -0800 Subject: [PATCH] Updating system packages playbook --- ansible/ansible.cfg | 3 +++ ansible/playbooks/update.yml | 20 ++++++++++++++++++++ 2 files changed, 23 insertions(+) create mode 100644 ansible/ansible.cfg create mode 100644 ansible/playbooks/update.yml diff --git a/ansible/ansible.cfg b/ansible/ansible.cfg new file mode 100644 index 0000000..1435620 --- /dev/null +++ b/ansible/ansible.cfg @@ -0,0 +1,3 @@ +[defaults] +stdout_callback = yaml + diff --git a/ansible/playbooks/update.yml b/ansible/playbooks/update.yml new file mode 100644 index 0000000..508bd38 --- /dev/null +++ b/ansible/playbooks/update.yml @@ -0,0 +1,20 @@ +# Purpose: General update to the system to keep packages up to date +--- +- hosts: webhost + remote_user: webadmin + tasks: + - name: Informational Dump of what is upgradeable + ansible.builtin.command: apt list --upgradable + register: pkg + - name: Show list of packages to upgrade + ansible.builtin.debug: + msg: "{{ pkg.stdout_lines }}" + - name: Update the packages at the system level to the latest versions + become: true + ansible.builtin.apt: + name: "*" + state: latest + + + +