-
Notifications
You must be signed in to change notification settings - Fork 0
/
site.yml
executable file
·38 lines (38 loc) · 977 Bytes
/
site.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
#!/usr/bin/ansible-playbook
---
- name: Site
become: true
hosts: all
gather_facts: false
pre_tasks:
- name: Run setup tasks
ansible.builtin.include_tasks: setup.yml
tags: always
tasks:
- name: Run host-specific early tasks
ansible.builtin.include_tasks: "{{ tasksfile }}"
with_fileglob:
- "tasks/{{ ansible_hostname }}.yml"
loop_control:
loop_var: tasksfile
- name: Run global roles
ansible.builtin.include_role:
name: "{{ host_role }}"
apply:
tags:
- "{{ host_role }}"
tags: always
loop_control:
loop_var: host_role
loop: "{{ my_roles }}"
- name: Run host-specific roles
when: host_roles is defined
ansible.builtin.include_role:
name: "{{ host_role }}"
apply:
tags:
- "{{ host_role }}"
tags: always
loop_control:
loop_var: host_role
loop: "{{ host_roles }}"