From 1541a2446766bae5ff9c72fe9f344cc1eff40c41 Mon Sep 17 00:00:00 2001 From: staticsafe Date: Sun, 17 Jan 2021 19:14:31 -0500 Subject: [PATCH] add package-update role --- ubuntu/package-update.yml | 7 +++++++ ubuntu/roles/package-update/tasks/main.yml | 5 +++++ 2 files changed, 12 insertions(+) create mode 100644 ubuntu/package-update.yml create mode 100644 ubuntu/roles/package-update/tasks/main.yml diff --git a/ubuntu/package-update.yml b/ubuntu/package-update.yml new file mode 100644 index 0000000..9042f8f --- /dev/null +++ b/ubuntu/package-update.yml @@ -0,0 +1,7 @@ +--- +- name: Update packages on nodes + hosts: cloud + user: root + + roles: + - package-update diff --git a/ubuntu/roles/package-update/tasks/main.yml b/ubuntu/roles/package-update/tasks/main.yml new file mode 100644 index 0000000..2f04dad --- /dev/null +++ b/ubuntu/roles/package-update/tasks/main.yml @@ -0,0 +1,5 @@ +--- +# This role updates packages and performs autoremove + +- name: Update apt cache and then packages with autoremove + apt: update_cache=yes upgrade=safe autoremove=yes