Skip to content
Snippets Groups Projects
Verified Commit fafd57ec authored by Jaromír Hradil's avatar Jaromír Hradil
Browse files

Refactoring REST path joining

parent 1eecaf4d
Branches
No related tags found
No related merge requests found
This commit is part of merge request !11. Comments created here will be created in the context of that merge request.
...@@ -3,11 +3,11 @@ ...@@ -3,11 +3,11 @@
hosts: master hosts: master
vars: vars:
nexus_url: "https://{{ nexus_hostname }}/service/rest/v1" nexus_url: "https://{{ nexus_hostname }}/service/rest/v1"
nexus_admin_password: "{{ lookup('community.hashi_vault.hashi_vault', vault_mount_point + '/nexus_admin_password:value', token_validate=false) }}" nexus_admin_password: "{{ lookup('community.hashi_vault.hashi_vault', (vault_mount_point, 'nexus_admin_password:value') | join('/'), token_validate=false) }}"
nexus_binder_password: "{{ lookup('community.hashi_vault.hashi_vault', vault_mount_point + '/nexus_binder_password:value', token_validate=false) }}" nexus_binder_password: "{{ lookup('community.hashi_vault.hashi_vault', (vault_mount_point, 'nexus_binder_password:value') | join('/'), token_validate=false) }}"
nexus_notebooks_password: "{{ lookup('community.hashi_vault.hashi_vault', vault_mount_point + '/nexus_notebooks_password:value', nexus_notebooks_password: "{{ lookup('community.hashi_vault.hashi_vault', (vault_mount_point, 'nexus_notebooks_password:value') | join('/'),
token_validate=false) }}" token_validate=false) }}"
nexus_writer_password: "{{ lookup('community.hashi_vault.hashi_vault', vault_mount_point + '/nexus_writer_password:value', token_validate=false) }}" nexus_writer_password: "{{ lookup('community.hashi_vault.hashi_vault', (vault_mount_point, 'nexus_writer_password:value') | join('/'), token_validate=false) }}"
nexus_blobstore_name: default nexus_blobstore_name: default
nexus_blobstore_type: file nexus_blobstore_type: file
nexus_repository_name: container-notebooks nexus_repository_name: container-notebooks
......
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
vars: vars:
name: cesnet-mcc name: cesnet-mcc
set_fact: set_fact:
secrets: "{{ lookup('community.hashi_vault.hashi_vault', vault_mount_point + '/gateway-' + name, token_validate=false) }}" secrets: "{{ lookup('community.hashi_vault.hashi_vault', (vault_mount_point, 'gateway-' + name) | join('/'), token_validate=false) }}"
- name: Enterprise Gateway Configuration - name: Enterprise Gateway Configuration
copy: copy:
dest: /tmp/gateway.yaml dest: /tmp/gateway.yaml
......
...@@ -50,7 +50,7 @@ ...@@ -50,7 +50,7 @@
mode: 0644 mode: 0644
- name: Mails settings - name: Mails settings
vars: vars:
fip_hostname: "{{ lookup('dig', groups['fip'][0] + '/PTR') | regex_replace('\\.$', '') }}" fip_hostname: "{{ lookup('dig', (groups['fip'][0], 'PTR') | join('/')) | regex_replace('\\.$', '') }}"
block: block:
- name: Global postfix settings - name: Global postfix settings
set_fact: set_fact:
......
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
vars: vars:
name: "{{ item | basename | splitext | first }}" name: "{{ item | basename | splitext | first }}"
set_fact: set_fact:
secrets: "{{ secrets|default({}) | combine({name: lookup('community.hashi_vault.hashi_vault', vault_mount_point + '/deployment-' + name, secrets: "{{ secrets|default({}) | combine({name: lookup('community.hashi_vault.hashi_vault', (vault_mount_point, 'deployment-' + name) | join('/'),
token_validate=false)}) }}" token_validate=false)}) }}"
with_fileglob: with_fileglob:
- "../deployments/*.yaml" - "../deployments/*.yaml"
......
...@@ -18,7 +18,7 @@ ...@@ -18,7 +18,7 @@
tasks: tasks:
- name: Get Secrets From Vault - name: Get Secrets From Vault
set_fact: set_fact:
secret: "{{ lookup('community.hashi_vault.hashi_vault', vault_mount_point + '/site-' + site_name, token_validate=false) }}" secret: "{{ lookup('community.hashi_vault.hashi_vault', (vault_mount_point, 'site-' + site_name) | join('/'), token_validate=false) }}"
- name: Debug Secrets - name: Debug Secrets
debug: debug:
msg: "{{ item.key }} = {{ item.value }}" msg: "{{ item.key }} = {{ item.value }}"
......
...@@ -46,7 +46,7 @@ ...@@ -46,7 +46,7 @@
when: "'fluent' not in ansible_local.helm_repos | map(attribute='name') | list" when: "'fluent' not in ansible_local.helm_repos | map(attribute='name') | list"
- name: Get Secrets from Vault - name: Get Secrets from Vault
set_fact: set_fact:
secrets: "{{ lookup('community.hashi_vault.hashi_vault', vault_mount_point + '/site-' + site_name, secrets: "{{ lookup('community.hashi_vault.hashi_vault', (vault_mount_point, 'site-' + site_name) | join('/'),
token_validate=false) }}" token_validate=false) }}"
- name: Debug Secrets - name: Debug Secrets
debug: debug:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment