Oliver Davies
7ee57545ce
Allow for appending ansible-playbook arguments to the dotfiles script, and automatically applying tags to the included roles. For example: `./bin/dotfiles --tags=neovim`
24 lines
496 B
YAML
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
|