mirror of
https://github.com/kubernetes-sigs/kubespray.git
synced 2026-05-07 17:37:39 -02:30
refactor vault role (#2733)
* Move front-proxy-client certs back to kube mount We want the same CA for all k8s certs * Refactor vault to use a third party module The module adds idempotency and reduces some of the repetitive logic in the vault role Requires ansible-modules-hashivault on ansible node and hvac on the vault hosts themselves Add upgrade test scenario Remove bootstrap-os tags from tasks * fix upgrade issues * improve unseal logic * specify ca and fix etcd check * Fix initialization check bump machine size
This commit is contained in:
@@ -1,20 +1,10 @@
|
||||
---
|
||||
- name: shared/auth_backend | Test if the auth backend exists
|
||||
uri:
|
||||
url: "{{ vault_leader_url }}/v1/sys/auth/{{ auth_backend_path }}/tune"
|
||||
headers: "{{ vault_headers }}"
|
||||
validate_certs: false
|
||||
ignore_errors: true
|
||||
register: vault_auth_backend_check
|
||||
|
||||
- name: shared/auth_backend | Add the cert auth backend if needed
|
||||
uri:
|
||||
url: "{{ vault_leader_url }}/v1/sys/auth/{{ auth_backend_path }}"
|
||||
headers: "{{ vault_headers }}"
|
||||
method: POST
|
||||
body_format: json
|
||||
body:
|
||||
description: "{{ auth_backend_description|d('') }}"
|
||||
type: "{{ auth_backend_type }}"
|
||||
status_code: 204
|
||||
when: vault_auth_backend_check|failed
|
||||
- name: shared/auth_backend | Enable auth backend {{ auth_backend_path }}
|
||||
hashivault_auth_enable:
|
||||
url: "{{ vault_leader_url }}"
|
||||
token: "{{ vault_root_token }}"
|
||||
ca_cert: "{{ vault_cert_dir }}/ca.pem"
|
||||
name: "{{ auth_backend_type }}"
|
||||
mount_point: "{{ auth_backend_path }}"
|
||||
description: "{{ auth_backend_description|d('') }}"
|
||||
register: result
|
||||
|
||||
Reference in New Issue
Block a user