added archlinux support to package upgrades roles

This commit is contained in:
Radar231 2022-05-09 07:41:55 -04:00
parent dafc6f219c
commit 193200aa85
1 changed files with 13 additions and 0 deletions

View File

@ -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