-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.yml
36 lines (32 loc) · 819 Bytes
/
main.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
---
- name: Dotefiles config
hosts: localhost
connection: local
pre_tasks:
- name: Stoe whoami
ansible.builtin.set_fact:
whoami: "{{ lookup('env', 'USER') }}"
tags:
- always
tasks:
- name: Set roles
ansible.builtin.set_fact:
run_roles: "{{ ansible_run_tags != ['all'] and ansible_run_tags or default_roles | difference(exclude_roles | default([])) }}"
tags:
- always
- name: Display roles
ansible.builtin.debug:
var: run_roles
tags:
- always
- name: Run roles
ansible.builtin.include_role:
apply:
tags:
- "{{ roles_item }}"
name: "{{ roles_item }}"
loop_control:
loop_var: roles_item
with_items: "{{ run_roles }}"
tags:
- always