simplify playbook

This commit is contained in:
Pim Kunis 2023-01-23 10:10:48 +01:00
parent 4ba31e275d
commit 88709a460e
4 changed files with 25 additions and 27 deletions

View file

@ -2,4 +2,4 @@ all:
ansible-playbook playbooks/all.yml
%:
ansible-playbook --extra-vars "enable_roles=['$@']" playbooks/all.yml
ansible-playbook playbooks/all.yml --tags "$@"

View file

@ -4,15 +4,3 @@ full_name: "{{ first_name }} {{ last_name }}"
email: pim@kunis.nl
vscodium_extensions:
- shd101wyy.markdown-preview-enhanced
enable_roles:
- bash
- alacritty
- wireguard
- asdf
- neovim
- signal
- virtualbox
- vscodium
- syncthing
- strawberry
- nicotine

View file

@ -1,8 +0,0 @@
# https://stackoverflow.com/a/55524120
- name: Rescue role
block:
- include_role:
name: "{{ item_my_role }}"
rescue:
- set_fact:
failed_roles: "{{ failed_roles|default([]) + [ item_my_role ] }}"

View file

@ -1,9 +1,27 @@
- name: Setup system
hosts: self
roles:
- system
tasks:
- include_tasks: "../library/rescue_role.yml"
loop: "{{ enable_roles }}"
loop_control:
loop_var: item_my_role
- role: system
tags: system
- role: bash
tags: bash
- role: alacritty
tags: alacritty
- role: wireguard
tags: wireguard
- role: asdf
tags: asdf
- role: neovim
tags: neovim
- role: signal
tags: signal
- role: virtualbox
tags: virtualbox
- role: vscodium
tags: vscodium
- role: syncthing
tags: syncthing
- role: strawberry
tags: strawberry
- role: nicotine
tags: nicotine