Skip to content

Commit

Permalink
Changed when clause to use vault_tls_disable & vault_tls_gossip as bo…
Browse files Browse the repository at this point in the history
…ol 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 <[email protected]>
  • Loading branch information
lakrass and lakrass authored Dec 12, 2024
1 parent 381881a commit e45fca8
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 %}"
Expand Down
4 changes: 2 additions & 2 deletions tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit e45fca8

Please sign in to comment.