Fixed update role
Add testing repo to Alpine hosts
This commit is contained in:
parent
b3d85445c5
commit
86e3fa9d72
@ -4,14 +4,6 @@
|
|||||||
pacman: name={{ packages }} state=latest
|
pacman: name={{ packages }} state=latest
|
||||||
when: "'pacman' in group_names"
|
when: "'pacman' in group_names"
|
||||||
tags: pacman
|
tags: pacman
|
||||||
- name: Add some repos (alpine)
|
|
||||||
become: yes
|
|
||||||
shell: cmd="cat > /etc/apk/repositories << EOF; $(echo)
|
|
||||||
https://dl-cdn.alpinelinux.org/alpine/v$(cat /etc/alpine-release | cut -d'.' -f1,2)/main/
|
|
||||||
https://dl-cdn.alpinelinux.org/alpine/v$(cat /etc/alpine-release | cut -d'.' -f1,2)/community/
|
|
||||||
https://dl-cdn.alpinelinux.org/alpine/edge/testing/
|
|
||||||
EOF"
|
|
||||||
when: "'alpine' in group_names"
|
|
||||||
- name: Install the good stuff (apk)
|
- name: Install the good stuff (apk)
|
||||||
apk: name={{ packages }} state=latest
|
apk: name={{ packages }} state=latest
|
||||||
when: "'apk' in group_names or 'alpine' in group_names"
|
when: "'apk' in group_names or 'alpine' in group_names"
|
||||||
|
@ -1,17 +0,0 @@
|
|||||||
- name: Update and upgrade pacman packages
|
|
||||||
pacman:
|
|
||||||
update_cache: yes
|
|
||||||
upgrade: yes
|
|
||||||
tags: pacman
|
|
||||||
- name: Update and upgrade apk packages
|
|
||||||
become: true
|
|
||||||
apk:
|
|
||||||
update_cache: yes
|
|
||||||
upgrade: yes
|
|
||||||
tags: apk
|
|
||||||
- name: Update and upgrade apt packages
|
|
||||||
become: true
|
|
||||||
apt:
|
|
||||||
update_cache: yes
|
|
||||||
upgrade: yes
|
|
||||||
tags: apt
|
|
39
roles/update/tasks/main.yml
Normal file
39
roles/update/tasks/main.yml
Normal file
@ -0,0 +1,39 @@
|
|||||||
|
- name: Update and upgrade pacman packages
|
||||||
|
pacman:
|
||||||
|
update_cache: yes
|
||||||
|
upgrade: yes
|
||||||
|
when: "'pacman' in group_names"
|
||||||
|
tags: pacman
|
||||||
|
|
||||||
|
# - name: Add some repos (alpine)
|
||||||
|
# become: yes
|
||||||
|
# shell: cmd="cat > /etc/apk/repositories << EOF; $(echo)
|
||||||
|
# https://dl-cdn.alpinelinux.org/alpine/v$(cat /etc/alpine-release | cut -d'.' -f1,2)/main/
|
||||||
|
# https://dl-cdn.alpinelinux.org/alpine/v$(cat /etc/alpine-release | cut -d'.' -f1,2)/community/
|
||||||
|
# https://dl-cdn.alpinelinux.org/alpine/edge/testing/
|
||||||
|
# EOF"
|
||||||
|
# when: "'alpine' in group_names"
|
||||||
|
# tags: alpine
|
||||||
|
- name: Add some repos (alpine)
|
||||||
|
become: yes
|
||||||
|
shell: |
|
||||||
|
grep -R 'testing' /etc/apk/repositories
|
||||||
|
[ $? == 1 ] && echo 'https://dl-cdn.alpinelinux.org/alpine/edge/testing/'>>/etc/apk/repositories
|
||||||
|
when: "'alpine' in group_names"
|
||||||
|
tags: alpine
|
||||||
|
|
||||||
|
- name: Update and upgrade apk packages
|
||||||
|
become: true
|
||||||
|
apk:
|
||||||
|
update_cache: yes
|
||||||
|
upgrade: yes
|
||||||
|
when: "'apk' in group_names or 'alpine' in group_names"
|
||||||
|
tags: apk
|
||||||
|
|
||||||
|
- name: Update and upgrade apt packages
|
||||||
|
become: true
|
||||||
|
apt:
|
||||||
|
update_cache: yes
|
||||||
|
upgrade: yes
|
||||||
|
when: "'apt' in group_names"
|
||||||
|
tags: apt
|
Loading…
Reference in New Issue
Block a user