|
7 | 7 | gather_subset: |
8 | 8 | - "distribution" |
9 | 9 | when: |
10 | | - - not ansible_facts.keys() | list | intersect(__run_proxmox_used_facts) == __run_proxmox_used_facts |
| 10 | + - not ansible_facts.keys() | list | intersect(__pve_proxmox_used_facts) == __pve_proxmox_used_facts |
11 | 11 |
|
12 | 12 |
|
13 | 13 | - name: "Init | Include role meta data" |
14 | 14 | ansible.builtin.include_vars: |
15 | 15 | file: "../meta/main.yml" |
16 | | - name: "__run_proxmox_meta" |
| 16 | + name: "__pve_proxmox_meta" |
17 | 17 |
|
18 | 18 |
|
19 | 19 | - name: "Init | Check Ansible version requirement and fail if unmet" |
20 | 20 | ansible.builtin.fail: |
21 | 21 | msg: > |
22 | | - This role requires Ansible {{ __run_proxmox_meta['galaxy_info']['min_ansible_version'] }} |
| 22 | + This role requires Ansible {{ __pve_proxmox_meta['galaxy_info']['min_ansible_version'] }} |
23 | 23 | or higher. You are currently running Ansible {{ ansible_version['full'] }} . |
24 | 24 | when: |
25 | | - - ansible_version['full'] is version_compare(__run_proxmox_meta['galaxy_info']['min_ansible_version'], "<") |
| 25 | + - ansible_version['full'] is version_compare(__pve_proxmox_meta['galaxy_info']['min_ansible_version'], "<") |
26 | 26 |
|
27 | 27 |
|
28 | 28 | - name: "Init | Notify when platform support check is not possible" |
|
36 | 36 | ansible_facts['distribution'] is not defined or |
37 | 37 | ansible_facts['distribution_version'] is not defined or |
38 | 38 | ansible_facts['distribution_major_version'] is not defined or |
39 | | - (__run_proxmox_supported_platforms | length) < 1 |
| 39 | + (__pve_proxmox_supported_platforms | length) < 1 |
40 | 40 |
|
41 | 41 |
|
42 | 42 | - name: "Init | Warn when platform is unsupported" |
43 | 43 | ansible.builtin.fail: |
44 | 44 | msg: > |
45 | 45 | Neither {{ ansible_facts['distribution'] }} (distribution) nor {{ ansible_facts['os_family'] }} (os_family) |
46 | 46 | with versions '{{ ansible_facts['distribution_major_version'] }}', '{{ ansible_facts['distribution_version'] }}', |
47 | | - or 'all' is in the list of supported platforms from vars/main.yml: {{ __run_proxmox_supported_platforms }} |
| 47 | + or 'all' is in the list of supported platforms from vars/main.yml: {{ __pve_proxmox_supported_platforms }} |
48 | 48 | when: |
49 | | - - (__run_proxmox_supported_platforms | length) > 0 |
50 | | - - (__run_proxmox_supported_platforms |
| 49 | + - (__pve_proxmox_supported_platforms | length) > 0 |
| 50 | + - (__pve_proxmox_supported_platforms |
51 | 51 | | selectattr('name', 'match', '^(' ~ ansible_facts['distribution'] ~ '|' ~ ansible_facts['os_family'] ~ ')$', ignorecase=true) |
52 | 52 | | map(attribute='versions') | flatten |
53 | 53 | | select('match', '^(' ~ ansible_facts['distribution_major_version'] ~ '|' ~ ansible_facts['distribution_version'] ~ '|all)$', ignorecase=true) |
|
57 | 57 |
|
58 | 58 | - name: "Init | Set platform-specific filename list (most to least specific; raw with possible duplicates)" |
59 | 59 | ansible.builtin.set_fact: |
60 | | - __run_proxmox_platform_filenames_raw: |
| 60 | + __pve_proxmox_platform_filenames_raw: |
61 | 61 | - "{{ ansible_facts['distribution'].replace(' ', '_') | lower }}_{{ ansible_facts['distribution_version'].replace(' ', '_') | lower }}.yml" |
62 | 62 | - "{{ ansible_facts['distribution'].replace(' ', '_') | lower }}_{{ ansible_facts['distribution_major_version'].replace(' ', '_') | lower }}.yml" |
63 | 63 | - "{{ ansible_facts['distribution'].replace(' ', '_') | lower }}.yml" |
|
66 | 66 |
|
67 | 67 | - name: "Init | Set unique platform-specific filename list (most to least specific)" |
68 | 68 | ansible.builtin.set_fact: |
69 | | - __run_proxmox_platform_filenames_most_specific_first: "{{ (__run_proxmox_platform_filenames_raw | ansible.builtin.unique | default([])) }}" |
| 69 | + __pve_proxmox_platform_filenames_most_specific_first: "{{ (__pve_proxmox_platform_filenames_raw | ansible.builtin.unique | default([])) }}" |
70 | 70 |
|
71 | 71 |
|
72 | 72 | - name: "Init | Set unique platform-specific filename list (least to most specific)" |
73 | 73 | ansible.builtin.set_fact: |
74 | | - __run_proxmox_platform_filenames_most_specific_last: "{{ __run_proxmox_platform_filenames_most_specific_first | reverse }}" |
| 74 | + __pve_proxmox_platform_filenames_most_specific_last: "{{ __pve_proxmox_platform_filenames_most_specific_first | reverse }}" |
75 | 75 |
|
76 | 76 |
|
77 | 77 | - name: "Init | Include platform-specific variables (if any), overwrite values with more specific ones" |
78 | 78 | ansible.builtin.include_vars: |
79 | | - file: "{{ __run_proxmox_vars_file }}" |
| 79 | + file: "{{ __pve_proxmox_vars_file }}" |
80 | 80 | vars: |
81 | | - __run_proxmox_vars_file: "{{ role_path }}/vars/{{ item }}" |
| 81 | + __pve_proxmox_vars_file: "{{ role_path }}/vars/{{ item }}" |
82 | 82 | when: |
83 | | - - __run_proxmox_vars_file is file |
84 | | - loop: "{{ __run_proxmox_platform_filenames_most_specific_last }}" |
| 83 | + - __pve_proxmox_vars_file is file |
| 84 | + loop: "{{ __pve_proxmox_platform_filenames_most_specific_last }}" |
85 | 85 |
|
86 | 86 |
|
87 | 87 | - name: "Init | Create temporary directory for file backups (disaster safeguard)" |
|
0 commit comments