forked from linux-system-roles/vpn
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathset_vars.yml
More file actions
39 lines (35 loc) · 1.29 KB
/
Copy pathset_vars.yml
File metadata and controls
39 lines (35 loc) · 1.29 KB
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
---
- name: Ensure ansible_facts used by role
setup:
gather_subset: "{{ __vpn_required_facts_subsets }}"
when: __vpn_required_facts |
difference(ansible_facts.keys() | list) | length > 0
- name: Record role begin fingerprint
sr_fingerprint:
sr_message: >-
begin system_role:vpn ansible_version={{ ansible_version.full }}
{{ ansible_facts['distribution'] }}-{{ ansible_facts['distribution_version'] }}
- name: Determine if system is ostree and set flag
when: not __vpn_is_ostree is defined
block:
- name: Check if system is ostree
ansible.builtin.stat:
path: /run/ostree-booted
register: __ostree_booted_stat
- name: Set flag to indicate system is ostree
ansible.builtin.set_fact:
__vpn_is_ostree: "{{ __ostree_booted_stat.stat.exists }}"
- name: Set platform/version specific variables
include_vars: "{{ __vpn_vars_file }}"
loop:
- "{{ ansible_facts['os_family'] }}.yml"
- "{{ ansible_facts['distribution'] }}.yml"
- >-
{{ ansible_facts['distribution'] ~ '_' ~
ansible_facts['distribution_major_version'] }}.yml
- >-
{{ ansible_facts['distribution'] ~ '_' ~
ansible_facts['distribution_version'] }}.yml
vars:
__vpn_vars_file: "{{ role_path }}/vars/{{ item }}"
when: __vpn_vars_file is file