-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.yml
39 lines (34 loc) · 904 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
37
38
39
---
# vim: set filetype=yaml.ansible : #
- name: DotFiles Config
hosts: localhost
connection: local
pre_tasks:
- name: Register Current User
ansible.builtin.set_fact:
host_user: "{{ ansible_env['USER'] }}"
when: host_user is not defined
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