ansible/roles/wireguard/tasks/main.yaml

37 lines
1.0 KiB
YAML
Raw Normal View History

2022-08-30 12:51:47 +00:00
---
- name: gather os specific variables
2022-08-31 03:19:06 +00:00
ansible.builtin.include_vars: "{{ lookup('first_found', params) }}"
2022-08-30 12:51:47 +00:00
vars:
2022-08-31 03:19:06 +00:00
params:
2022-08-30 12:51:47 +00:00
files:
- "{{ ansible_distribution }}-{{ ansible_distribution_version }}.yaml"
- "{{ ansible_distribution }}.yaml"
- "{{ ansible_os_family }}.yaml"
- "default.yaml"
paths:
- vars
- name: include os specific tasks
2022-08-31 03:19:06 +00:00
ansible.builtin.include_tasks: "{{ lookup('first_found', params) }}"
2022-08-30 12:51:47 +00:00
vars:
2022-08-31 03:19:06 +00:00
params:
2022-08-30 12:51:47 +00:00
files:
- "{{ ansible_distribution }}-{{ ansible_distribution_version }}.yaml"
- "{{ ansible_distribution }}.yaml"
- "{{ ansible_os_family }}.yaml"
- "default.yaml"
paths:
- tasks
2022-08-31 03:19:06 +00:00
- ansible.builtin.include_tasks: install.yaml
2022-08-30 12:51:47 +00:00
2022-08-31 03:19:06 +00:00
#- ansible.builtin.include_tasks: configure.yaml
2022-08-30 12:51:47 +00:00
2022-08-31 03:19:06 +00:00
- ansible.builtin.include_tasks: configure-interface.yaml
2022-08-30 12:51:47 +00:00
loop: "{{ wireguard_interfaces.keys() | list }}"
loop_control:
loop_var: _wireguard_interface
when:
- wireguard_interfaces is mapping
- wireguard_interfaces.keys() | length