ansible/roles/update/tasks/main.yml

51 lines
1.4 KiB
YAML
Raw Permalink Normal View History

2022-12-16 15:39:49 +00:00
---
- name: Update and upgrade package managed stuff
2022-12-19 12:59:24 +00:00
when: update
2022-12-16 15:39:49 +00:00
block:
# - name: Install yay (AUR helper)
2022-12-16 15:39:49 +00:00
# - name: Update and upgrade yay packages
# yay: update_cache=yes upgrade=yes
# when: package_manager == 'yay' or 'yay' in group_names
2022-12-16 15:39:49 +00:00
- name: Update and upgrade pacman packages
become: true
shell: pacman -Syu --noconfirm
when: package_manager == 'yay' or 'yay' in group_names
2022-12-16 15:39:49 +00:00
- name: Add some repos (alpine)
become: true
shell: |
grep -R 'testing' /etc/apk/repositories
if [ $? == 1 ]; then
echo 'https://dl-cdn.alpinelinux.org/alpine/edge/testing'\
>>/etc/apk/repositories
fi
when: "'alpine' in group_names"
2022-12-19 12:59:24 +00:00
- name: Update, upgrade and autoremove xbps packages
2022-12-16 15:39:49 +00:00
become: true
shell: xbps-install -ASuvy && xbps-remove -ROoy
2022-12-16 15:39:49 +00:00
when: package_manager == 'xbps' or 'xbps' in group_names
2022-12-16 15:39:49 +00:00
- name: Update and upgrade apk packages
become: true
apk:
update_cache: true
upgrade: true
2022-12-19 12:59:24 +00:00
state: 'latest'
2022-12-16 15:39:49 +00:00
when: package_manager == 'apk' or 'apk' in group_names
- name: Update and upgrade apt packages
become: true
apt:
update_cache: true
2022-12-19 12:59:24 +00:00
autoremove: true
2022-12-16 15:39:49 +00:00
upgrade: true
when: package_manager == 'apt' or 'apt' in group_names
- name: Update and upgrade portage packages
become: true
shell: eix-sync && emerge -uDNU --with-bdeps=y @world
when: package_manager == 'emerge' or 'emerge' in group_names