From 193200aa85013795b5525b6d609928172e91a47d Mon Sep 17 00:00:00 2001 From: Radar231 Date: Mon, 9 May 2022 07:41:55 -0400 Subject: [PATCH] added archlinux support to package upgrades roles --- tasks/main.yml | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/tasks/main.yml b/tasks/main.yml index af856ff..9771528 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -32,4 +32,17 @@ debug: msg={{ dchkout }} when: dchkout.stdout_lines is undefined and ansible_os_family == "Debian" +- name: Checked for updates (Arch based distros) + shell: + cmd: pacman -Qu + register: achkout + when: ansible_os_family == "Archlinux" + # 'pacman -Qu' returns a 1 when no packages require upgrade + # this line stops the role from failing with a 'non-zero result' + failed_when: "achkout.rc not in [ 0, 1 ]" + +- name: Show output from update check (arch 1) + debug: msg={{ achkout.stdout_lines }} + when: achkout.stdout_lines is defined and ansible_os_family == "Archlinux" + # EOF