-
Notifications
You must be signed in to change notification settings - Fork 0
/
playbook.yml
37 lines (34 loc) · 861 Bytes
/
playbook.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
---
- name: Dotfiles config
hosts: localhost
connection: local
tasks:
- name: List all dirs in roles
ansible.builtin.find:
paths: "{{ playbook_dir }}/roles"
file_type: directory
recurse: false
register: found_roles_dirs
tags:
- always
- name: Get roles names
ansible.builtin.set_fact:
run_roles: "{{ (run_roles | default([])) + [(item.path | basename)] }}"
loop:
"{{ found_roles_dirs.files | list }}"
loop_control:
label: "{{ item.path | basename }}"
tags:
- always
- name: Execute roles
ansible.builtin.include_role:
apply:
tags:
- "{{ role_name }}"
name: "{{ role_name }}"
loop:
"{{ run_roles }}"
loop_control:
loop_var: role_name
tags:
- always