ansible/roles/common/tasks/main.yml
Sivert V. Sæther a70d58f3f7 Ansible god!
Big rework!
Control stuffs with variables!
We still should do some movei'n around of roles before extending
features.
2022-03-23 02:03:04 +01:00

68 lines
1.8 KiB
YAML

- name: Install packages
when: update
block:
- name: Install packages (pacman)
when: "'pacman' in group_names"
tags: pacman
block:
- name: Install the good stuff (pacman)
pacman: name={{ item }} state=latest
ignore_errors: yes
with_items:
- "{{ extra_packages }}"
- "{{ packages }}"
rescue:
- name: Uninstall the good stuff (pacman)
pacman: name={{ item }} state=absent
with_items:
- "{{ extra_packages }}"
- "{{ packages }}"
- name: Install packages (apk)
when: "'apk' in group_names or 'alpine' in group_names"
tags: apk
block:
- name: Install the good stuff (apk)
apk: name={{ item }} state=latest
ignore_errors: yes
with_items:
- "{{ extra_packages }}"
- "{{ packages }}"
rescue:
- name: Uninstall the good stuff (apk)
apk: name={{ item }} state=absent
with_items:
- "{{ extra_packages }}"
- "{{ packages }}"
- name: Install packages (apt)
when: "'apt' in group_names"
tags: apt
block:
- name: Install the good stuff (apt)
apt: package={{ item }} state=latest
ignore_errors: yes
with_items:
- "{{ extra_packages }}"
- "{{ packages }}"
rescue:
- name: Uninstall the good stuff (apt)
apt: package={{ item }} state=absent
with_items:
- "{{ extra_packages }}"
- "{{ packages }}"
- name: Configure system packages
when: "'system' in setup"
block:
- name: Add /etc/doas.conf
copy: src=doas.conf dest=/etc/doas.conf owner=root group=root mode=0644
tags: system
- name: Configure user configs
when: "'user' in setup"
block:
- name: Add ~/.config/neofetch/
copy: src=neofetch dest=/home/{{ name }}/.config/neofetch owner={{ name }} group={{ name }} mode=0755
tags: config