dotfiles/main.yaml
Oliver Davies 7ee57545ce feat(*): allow for filtering the playbook by role
Allow for appending ansible-playbook arguments to the dotfiles script,
and automatically applying tags to the included roles.

For example:

`./bin/dotfiles --tags=neovim`
2022-04-20 21:45:45 +01:00

24 lines
496 B
YAML

---
- hosts: localhost
tasks:
- name: Set roles
ansible.builtin.set_fact:
roles: "{{ default_roles | difference(exclude_roles | default([])) }}"
tags:
- always
- name: Display roles
ansible.builtin.debug: "var=roles"
tags:
- always
- name: Run roles
ansible.builtin.include_role:
name: "{{ item }}"
apply:
tags:
- "{{ item }}"
with_items: "{{ roles }}"
tags:
- always