Skip to content

Commit ad4ef32

Browse files
Fix errors caused during refactoring / moving files around (path, varnames, escaping)
1 parent 148e725 commit ad4ef32

File tree

14 files changed

+57
-48
lines changed

14 files changed

+57
-48
lines changed

roles/pve/meta/argument_specs.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1498,7 +1498,7 @@ argument_specs:
14981498
encryption: "aes-256-gcm"
14991499
keyformat: "passphrase"
15001500
keylocation: "prompt"
1501-
passphrase: "{{ vault_zfs_passphrase }}"
1501+
passphrase: "\{\{ vault_passphrase \}\}"
15021502
15031503
# NFS backup storage
15041504
- name: "nfs-backup"
@@ -1731,7 +1731,7 @@ argument_specs:
17311731
encryption: "aes-256-gcm"
17321732
keyformat: "passphrase"
17331733
keylocation: "prompt"
1734-
passphrase: "{{ vault_passphrase }}"
1734+
passphrase: "\{\{ vault_passphrase \}\}"
17351735
passphrase_old:
17361736
- "12345aaaaarrrrRR"
17371737
- "456789bbbbbbbTTT"

roles/pve/tasks/init.yml

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -7,22 +7,22 @@
77
gather_subset:
88
- "distribution"
99
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
1111

1212

1313
- name: "Init | Include role meta data"
1414
ansible.builtin.include_vars:
1515
file: "../meta/main.yml"
16-
name: "__run_proxmox_meta"
16+
name: "__pve_proxmox_meta"
1717

1818

1919
- name: "Init | Check Ansible version requirement and fail if unmet"
2020
ansible.builtin.fail:
2121
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'] }}
2323
or higher. You are currently running Ansible {{ ansible_version['full'] }} .
2424
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'], "<")
2626

2727

2828
- name: "Init | Notify when platform support check is not possible"
@@ -36,18 +36,18 @@
3636
ansible_facts['distribution'] is not defined or
3737
ansible_facts['distribution_version'] is not defined or
3838
ansible_facts['distribution_major_version'] is not defined or
39-
(__run_proxmox_supported_platforms | length) < 1
39+
(__pve_proxmox_supported_platforms | length) < 1
4040

4141

4242
- name: "Init | Warn when platform is unsupported"
4343
ansible.builtin.fail:
4444
msg: >
4545
Neither {{ ansible_facts['distribution'] }} (distribution) nor {{ ansible_facts['os_family'] }} (os_family)
4646
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 }}
4848
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
5151
| selectattr('name', 'match', '^(' ~ ansible_facts['distribution'] ~ '|' ~ ansible_facts['os_family'] ~ ')$', ignorecase=true)
5252
| map(attribute='versions') | flatten
5353
| select('match', '^(' ~ ansible_facts['distribution_major_version'] ~ '|' ~ ansible_facts['distribution_version'] ~ '|all)$', ignorecase=true)
@@ -57,7 +57,7 @@
5757

5858
- name: "Init | Set platform-specific filename list (most to least specific; raw with possible duplicates)"
5959
ansible.builtin.set_fact:
60-
__run_proxmox_platform_filenames_raw:
60+
__pve_proxmox_platform_filenames_raw:
6161
- "{{ ansible_facts['distribution'].replace(' ', '_') | lower }}_{{ ansible_facts['distribution_version'].replace(' ', '_') | lower }}.yml"
6262
- "{{ ansible_facts['distribution'].replace(' ', '_') | lower }}_{{ ansible_facts['distribution_major_version'].replace(' ', '_') | lower }}.yml"
6363
- "{{ ansible_facts['distribution'].replace(' ', '_') | lower }}.yml"
@@ -66,22 +66,22 @@
6666

6767
- name: "Init | Set unique platform-specific filename list (most to least specific)"
6868
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([])) }}"
7070

7171

7272
- name: "Init | Set unique platform-specific filename list (least to most specific)"
7373
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 }}"
7575

7676

7777
- name: "Init | Include platform-specific variables (if any), overwrite values with more specific ones"
7878
ansible.builtin.include_vars:
79-
file: "{{ __run_proxmox_vars_file }}"
79+
file: "{{ __pve_proxmox_vars_file }}"
8080
vars:
81-
__run_proxmox_vars_file: "{{ role_path }}/vars/{{ item }}"
81+
__pve_proxmox_vars_file: "{{ role_path }}/vars/{{ item }}"
8282
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 }}"
8585

8686

8787
- name: "Init | Create temporary directory for file backups (disaster safeguard)"

roles/pve/templates/_render_cfg_value.j2

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{#-
22
Render helper: dict -> "k=v,k2=v2", only-mapping value as-is
3-
Import once from other templates files: {% from 'pve/_render_cfg_value.j2' import render_cfg_value %}
3+
Import once from other templates files: {% from '_render_cfg_value.j2' import render_cfg_value %}
44
-#}
55
{%- macro render_cfg_value(value) -%}
66
{%- if value is mapping -%}

roles/pve/templates/datacenter.cfg.j2

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
{# Normalize and/or validate input #}
66
{%- set pve_datacentercfg = tpl_pve_datacentercfg | default({}, true) -%}
7-
{%- from 'pve/_render_cfg_value.j2' import render_cfg_value -%}
7+
{%- from '_render_cfg_value.j2' import render_cfg_value -%}
88

99
{% if pve_datacentercfg | length > 0 %}
1010
{% for item in pve_datacentercfg | dict2items | sort(attribute='key') %}

roles/pve/templates/firewall/_aliases_block.j2

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{#-
22
Template to generate a Proxmox VE firewall [ALIASES] block. To be called
3-
from other templates files: {% include 'pve/firewall/_aliases_block.j2' %}
3+
from other templates files: {% include 'firewall/_aliases_block.j2' %}
44
55
Expects an 'fw_aliases' variable.
66
-#}

roles/pve/templates/firewall/_groups_block.j2

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{#-
22
Template to generate Proxmox VE firewall [group ...] blocks. To be called
3-
from other templates files: {% include 'pve/firewall/_groups_block.j2' %}
3+
from other templates files: {% include 'firewall/_groups_block.j2' %}
44
55
Expects an 'fw_securitygroups' variable.
66
-#}
@@ -25,7 +25,7 @@
2525
[group {{ group['name'] }}]{% if group['comment'] is defined %} # {{ group['comment'] }}{% endif %}
2626

2727
{% for rule in group['rules'] %}
28-
{% include 'pve/firewall/_rule_line.j2' %}
28+
{% include 'firewall/_rule_line.j2' %}
2929
{% endfor %}
3030

3131
{% endfor %}

roles/pve/templates/firewall/_ipsets_block.j2

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{#-
22
Template to generate Proxmox VE firewall [IPSET ...] blocks. To be called
3-
from other templates files: {% include 'pve/firewall/_ipsets_block.j2' %}
3+
from other templates files: {% include 'firewall/_ipsets_block.j2' %}
44
55
Expects an 'fw_ipsets' variable.
66
-#}

roles/pve/templates/firewall/_options_block.j2

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
{#-
22
Template to generate a Proxmox VE firewall [OPTIONS] block. To be called
3-
from other templates files: {% include 'pve/firewall/_options_block.j2' %}
3+
from other templates files: {% include 'firewall/_options_block.j2' %}
44
55
Expects an 'fw_options' variable.
66
-#}
7-
{%- from 'pve/_render_cfg_value.j2' import render_cfg_value -%}
7+
{%- from '_render_cfg_value.j2' import render_cfg_value -%}
88
{% if fw_options is defined and fw_options | length > 0 %}
99
[OPTIONS]
1010
{% for key, value in fw_options.items() %}

roles/pve/templates/firewall/_rule_line.j2

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{#-
22
Template to generate a Proxmox VE firewall rule line. To be called
3-
from other templates files: {% include 'pve/firewall/_rule_line.j2' %}
3+
from other templates files: {% include 'firewall/_rule_line.j2' %}
44
55
Expects a 'rule' variable:
66

roles/pve/templates/firewall/_rules_block.j2

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
{#-
22
Template to generate a Proxmox VE firewall [RULES] block. To be called
3-
from other templates files: {% include 'pve/firewall/_rules_block.j2' %}
3+
from other templates files: {% include 'firewall/_rules_block.j2' %}
44
55
Expects an 'fw_rules' variable.
66
-#}
77
{% if fw_rules is defined and fw_rules | length > 0 %}
88
[RULES]
99
{% for rule in fw_rules %}
10-
{% include 'pve/firewall/_rule_line.j2' %}
10+
{% include 'firewall/_rule_line.j2' %}
1111
{% endfor %}
1212
{% else %}
1313
# No [RULES] defined

0 commit comments

Comments
 (0)