From e45fca87c41775600147568cbbf56020ddaa1484 Mon Sep 17 00:00:00 2001 From: Leon Krass <62966452+lakrass@users.noreply.github.com> Date: Thu, 12 Dec 2024 20:35:54 +0100 Subject: [PATCH] Changed when clause to use vault_tls_disable & vault_tls_gossip as bool instead of int comparison (#359) * cast vault_tls_disable and vault_tls_gossip to bool instead of doing integer comparison * changed default values to bools instead of ints --------- Co-authored-by: lakrass --- defaults/main.yml | 4 ++-- tasks/main.yml | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/defaults/main.yml b/defaults/main.yml index 52b8975..dc46b36 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -295,8 +295,8 @@ vault_tls_certs_path: "{{ lookup('env', 'VAULT_TLS_DIR') | default(('/opt/vault/ vault_tls_private_path: "{{ lookup('env', 'VAULT_TLS_DIR') | default(('/opt/vault/tls' if (vault_install_hashi_repo) else '/etc/vault/tls'), true) }}" vault_tls_src_files: "{{ lookup('env', 'VAULT_TLS_SRC_FILES') | default(role_path ~ '/files', true) }}" -vault_tls_disable: "{{ lookup('env', 'VAULT_TLS_DISABLE') | default(1, true) }}" -vault_tls_gossip: "{{ lookup('env', 'VAULT_TLS_GOSSIP') | default(0, true) }}" +vault_tls_disable: "{{ lookup('env', 'VAULT_TLS_DISABLE') | default(true, true) }}" +vault_tls_gossip: "{{ lookup('env', 'VAULT_TLS_GOSSIP') | default(false, true) }}" vault_tls_copy_keys: "{{ false if (vault_install_hashi_repo) else true }}" vault_protocol: "{% if vault_tls_disable %}http{% else %}https{% endif %}" diff --git a/tasks/main.yml b/tasks/main.yml index ece8b53..aa3b248 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -121,11 +121,11 @@ - name: TLS configuration include_tasks: ../tasks/tls.yml - when: vault_tls_disable == 0 + when: not vault_tls_disable | bool - name: Backend storage TLS configuration include_tasks: ../tasks/backend_tls.yml - when: vault_tls_gossip == 1 + when: vault_tls_gossip | bool - name: "Get content of GCP Credentials from file" set_fact: