mirror of
https://github.com/kubernetes-sigs/kubespray.git
synced 2026-03-09 11:47:47 +03:00
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,25 +1,16 @@
|
||||
---
|
||||
|
||||
- name: cluster/unseal | Current sealed state
|
||||
debug: " Sealed? {{vault_is_sealed}}"
|
||||
debug:
|
||||
msg: "Sealed? {{ vault_is_sealed }}"
|
||||
|
||||
- name: cluster/unseal | Unseal Vault
|
||||
uri:
|
||||
url: "https://localhost:{{ vault_port }}/v1/sys/unseal"
|
||||
headers: "{{ vault_headers }}"
|
||||
method: POST
|
||||
body_format: json
|
||||
body:
|
||||
key: "{{ item }}"
|
||||
hashivault_unseal:
|
||||
url: "https://localhost:{{ vault_port }}/"
|
||||
token: "{{ vault_root_token }}"
|
||||
ca_cert: "{{ vault_cert_dir }}/ca.pem"
|
||||
keys: "{{ item }}"
|
||||
no_log: true
|
||||
with_items: "{{ vault_unseal_keys|default([]) }}"
|
||||
notify: wait for vault up
|
||||
when: vault_is_sealed
|
||||
|
||||
- name: cluster/unseal | Wait until server is ready
|
||||
uri:
|
||||
url: "https://localhost:{{ vault_port }}/v1/sys/health"
|
||||
headers: "{{ vault_headers }}"
|
||||
method: HEAD
|
||||
status_code: 200, 429
|
||||
register: vault_node_ready
|
||||
until: vault_node_ready|succeeded
|
||||
retries: 5
|
||||
|
||||
Reference in New Issue
Block a user