Compare commits

..

1 Commits
main ... init

Author SHA1 Message Date
dd769b19d4 improve the vault handling stuff 2023-06-29 16:06:41 +02:00
3 changed files with 41 additions and 97 deletions

File diff suppressed because it is too large Load Diff

View File

@ -1,4 +1,13 @@
--- ---
# Manage Vault configuration (policies, roles, accesses, etc)
#
# vault_instances is a dictionary ({instance_name: config}) containing all the
# required information that is being passed one by one into the configure_vault
# role for the execution with the help of Vault API invocation.
#
# variable `vault_create_auth=true` will force presence of auth methods which
# are otherwise (default) not created
#
- hosts: vault-controller:!disabled - hosts: vault-controller:!disabled
name: "Configure Vault instances" name: "Configure Vault instances"
tasks: tasks:

View File

@ -1,7 +1,8 @@
---
- name: Read Auth {{ auth.type }} at {{ auth.path }} - name: Read Auth {{ auth.type }} at {{ auth.path }}
check_mode: "no" check_mode: "no"
ansible.builtin.uri: ansible.builtin.uri:
url: "{{ vault_addr }}/v1/sys/auth/{{ auth.path }}/tune" url: "{{ vault_addr }}/v1/sys/auth/{{ auth.path }}"
headers: headers:
X-Vault-Token: "{{ vault_token }}" X-Vault-Token: "{{ vault_token }}"
method: "GET" method: "GET"
@ -28,7 +29,6 @@
passthrough_request_headers: "{{ auth.passthrough_request_headers | default(omit) }}" passthrough_request_headers: "{{ auth.passthrough_request_headers | default(omit) }}"
allowed_response_headers: "{{ auth.allowed_response_headers | default(omit) }}" allowed_response_headers: "{{ auth.allowed_response_headers | default(omit) }}"
options: "{{ auth.options | default(omit) }}" options: "{{ auth.options | default(omit) }}"
status_code: [200, 201, 202, 204] status_code: [200, 201, 202, 204]
when: when:
- "current_auth is not defined or current_auth.status != 200" - "current_auth is not defined or current_auth.status != 200"