increase fault tolerancy for the master playbook

add units apt packages
This commit is contained in:
Pim Kunis 2022-12-27 16:49:55 +01:00
parent 1bbbd8a952
commit 76d3b54c8d
3 changed files with 25 additions and 9 deletions

8
library/rescue_role.yml Normal file
View file

@ -0,0 +1,8 @@
# 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

@ -2,12 +2,19 @@
hosts: self hosts: self
roles: roles:
- system - system
- zsh vars:
- asdf my_roles:
- neovim - zsh
- signal - asdf
- virtualbox - neovim
- vscodium - signal
- syncthing - virtualbox
- strawberry - vscodium
- nicotine - syncthing
- strawberry
- nicotine
tasks:
- include_tasks: "../library/rescue_role.yml"
loop: "{{ my_roles }}"
loop_control:
loop_var: item_my_role

View file

@ -14,6 +14,7 @@
- gimp - gimp
- tree - tree
- wireshark - wireshark
- units
- name: Install .gitconfig - name: Install .gitconfig
template: template:
src: "{{ role_path }}/templates/.gitconfig.j2" src: "{{ role_path }}/templates/.gitconfig.j2"