ansible/roles/update/tasks/main.yml

51 lines
1.4 KiB
YAML

---
- name: Update and upgrade package managed stuff
when: update
block:
# - name: Install yay (AUR helper)
# - name: Update and upgrade yay packages
# yay: update_cache=yes upgrade=yes
# when: package_manager == 'yay' or 'yay' in group_names
- name: Update and upgrade pacman packages
become: true
shell: pacman -Syu --noconfirm
when: package_manager == 'yay' or 'yay' in group_names
- 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"
- name: Update, upgrade and autoremove xbps packages
become: true
shell: xbps-install -Suv && xbps-remove -ROo
when: package_manager == 'xbps' or 'xbps' in group_names
- name: Update and upgrade apk packages
become: true
apk:
update_cache: true
upgrade: true
state: 'latest'
when: package_manager == 'apk' or 'apk' in group_names
- name: Update and upgrade apt packages
become: true
apt:
update_cache: true
autoremove: true
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