ansible/roles/update/tasks/main.yml

42 lines
1001 B
YAML
Raw Normal View History

# - name: Install yay (AUR helper)
# - name: Update and upgrade pacman packages
# become: yes
# pacman:
# executable: yay
# update_cache: yes
# upgrade: yes
# when: 'pacman'
# tags: pacman
- name: Update and upgrade pacman packages
become: yes
shell: pacman -Syu --noconfirm
when: package_manager == 'pacman' or 'pacman' in group_names
tags: update
- name: Add some repos (alpine)
become: yes
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"
tags: update alpine
- name: Update and upgrade apk packages
become: yes
apk:
update_cache: yes
upgrade: yes
when: package_manager == 'apk' or 'apk' in group_names
tags: update
- name: Update and upgrade apt packages
become: yes
apt:
update_cache: yes
upgrade: yes
when: package_manager == 'apt' or 'apt' in group_names
tags: update