ansible/roles/common/tasks/main.yml
Sivert V. Sæther 86e3fa9d72 Fixed update role
Add testing repo to Alpine hosts
2022-03-14 09:30:53 +01:00

36 lines
1.1 KiB
YAML

- name: Install and configure packages
block:
- name: Install the good stuff (pacman)
pacman: name={{ packages }} state=latest
when: "'pacman' in group_names"
tags: pacman
- name: Install the good stuff (apk)
apk: name={{ packages }} state=latest
when: "'apk' in group_names or 'alpine' in group_names"
tags: apk
- name: Install the good stuff (apt)
apt: package={{ packages }} state=latest
when: "'apt' in group_names"
tags: apt
- name: Add /etc/doas.conf
copy: src=doas.conf dest=/etc/doas.conf owner=root group=root mode=0644
tags: system
rescue:
- name: Uninstall the good stuff (pacman)
pacman: name={{ packages }} state=absent
when: "'pacman' in group_names"
tags: pacman
- name: Uninstall the good stuff (apk)
apk: name={{ packages }} state=absent
when: "'apk' in group_names or 'alpine' in group_names"
tags: apk
- name: Uninstall the good stuff (apt)
apt: package={{ packages }} state=absent
when: "'apt' in group_names"
tags: apt
- name: Remove /etc/doas.conf
file: state=absent path=/etc/doas.conf
tags: system