Skip to content

Commit 94cc14b

Browse files
dguidoclaude
andcommitted
Fix critical algo_no_log variable consistency across all roles
CRITICAL FIX: Undefined variable errors in multiple roles - Add default(true) filter to all algo_no_log references - Affected files: - roles/wireguard/tasks/keys.yml:27,68,103 - roles/strongswan/tasks/client_configs.yml:26 - roles/ssh_tunneling/tasks/main.yml:69,81 PROBLEM: When roles are used independently or algo_no_log is undefined, tasks would fail with "undefined variable" errors, breaking deployments. SOLUTION: Use {{ algo_no_log | default(true) | bool }} pattern throughout - Provides safe fallback to secure-by-default behavior (logging disabled) - Maintains compatibility when algo_no_log is defined in config.cfg - Prevents deployment failures from undefined variables IMPACT: Ensures consistent and reliable log hiding behavior across all VPN roles, preventing critical deployment failures. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
1 parent 3f56238 commit 94cc14b

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

roles/ssh_tunneling/tasks/main.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@
6767
passphrase: "{{ p12_export_password }}"
6868
cipher: auto
6969
force: false
70-
no_log: "{{ algo_no_log|bool }}"
70+
no_log: "{{ algo_no_log | default(true) | bool }}"
7171
when: not item.stat.exists
7272
with_items: "{{ privatekey.results }}"
7373
register: openssl_privatekey
@@ -79,7 +79,7 @@
7979
privatekey_passphrase: "{{ p12_export_password }}"
8080
format: OpenSSH
8181
force: true
82-
no_log: "{{ algo_no_log|bool }}"
82+
no_log: "{{ algo_no_log | default(true) | bool }}"
8383
when: item.changed
8484
with_items: "{{ openssl_privatekey.results }}"
8585

roles/strongswan/tasks/client_configs.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
with_together:
2424
- "{{ users }}"
2525
- "{{ PayloadContent.results }}"
26-
no_log: "{{ algo_no_log|bool }}"
26+
no_log: "{{ algo_no_log | default(true) | bool }}"
2727

2828
- name: Build the client ipsec config file
2929
template:

roles/wireguard/tasks/keys.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
dest: "{{ wireguard_pki_path }}/private/{{ item['item'] }}"
2525
content: "{{ item['stdout'] }}"
2626
mode: "0600"
27-
no_log: "{{ algo_no_log|bool }}"
27+
no_log: "{{ algo_no_log | default(true) | bool }}"
2828
when: item.changed
2929
with_items: "{{ wg_genkey['results'] }}"
3030
delegate_to: localhost
@@ -65,7 +65,7 @@
6565
dest: "{{ wireguard_pki_path }}/preshared/{{ item['item'] }}"
6666
content: "{{ item['stdout'] }}"
6767
mode: "0600"
68-
no_log: "{{ algo_no_log|bool }}"
68+
no_log: "{{ algo_no_log | default(true) | bool }}"
6969
when: item.changed
7070
with_items: "{{ wg_genpsk['results'] }}"
7171
delegate_to: localhost
@@ -100,7 +100,7 @@
100100
dest: "{{ wireguard_pki_path }}/public/{{ item['item'] }}"
101101
content: "{{ item['stdout'] }}"
102102
mode: "0600"
103-
no_log: "{{ algo_no_log|bool }}"
103+
no_log: "{{ algo_no_log | default(true) | bool }}"
104104
with_items: "{{ wg_pubkey['results'] }}"
105105
delegate_to: localhost
106106
become: false

0 commit comments

Comments
 (0)