2022-01-05 21:24:28 +00:00
|
|
|
---
|
|
|
|
- hosts: localhost
|
2022-04-17 16:01:58 +00:00
|
|
|
tasks:
|
|
|
|
- name: Set roles
|
2022-04-20 20:31:46 +00:00
|
|
|
ansible.builtin.set_fact:
|
2022-04-26 20:42:59 +00:00
|
|
|
roles: "{{ ansible_run_tags != ['all'] and ansible_run_tags or default_roles | difference(exclude_roles | default([])) }}"
|
2022-04-20 20:31:46 +00:00
|
|
|
tags:
|
|
|
|
- always
|
2022-04-17 16:01:58 +00:00
|
|
|
|
|
|
|
- name: Display roles
|
2022-04-20 20:31:46 +00:00
|
|
|
ansible.builtin.debug: "var=roles"
|
|
|
|
tags:
|
|
|
|
- always
|
2022-04-17 16:01:58 +00:00
|
|
|
|
|
|
|
- name: Run roles
|
2022-04-20 20:31:46 +00:00
|
|
|
ansible.builtin.include_role:
|
2022-04-17 16:01:58 +00:00
|
|
|
name: "{{ item }}"
|
2022-04-20 20:31:46 +00:00
|
|
|
apply:
|
|
|
|
tags:
|
|
|
|
- "{{ item }}"
|
2022-04-17 16:01:58 +00:00
|
|
|
with_items: "{{ roles }}"
|
2022-04-20 20:31:46 +00:00
|
|
|
tags:
|
|
|
|
- always
|