Skip to content

Commit 74a6aa9

Browse files
technowhizzAlex-Welsh
authored andcommitted
Add check to ensure vault is unsealed
If vault is not unsealed, the task used to fail with `role not found or permission denied` which is confusing for users. This commit adds a check to ensure vault is unsealed before attempting to generate the certificate.
1 parent 84d738a commit 74a6aa9

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

etc/kayobe/ansible/pulp/pulp-generate-certificate.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,17 @@
1717
file: "{{ kayobe_env_config_path }}/openbao/seed-openbao-keys.json"
1818
name: openbao_keys
1919

20+
- name: Check OpenBao seal status
21+
ansible.builtin.uri:
22+
url: "{{ openbao_api_addr }}/v1/sys/seal-status"
23+
return_content: true
24+
register: openbao_seal_status
25+
26+
- name: Assert that OpenBao is unsealed
27+
ansible.builtin.assert:
28+
that: not openbao_seal_status.json.sealed
29+
fail_msg: "OpenBao is sealed. Please unseal it before continuing."
30+
2031
- name: Issue Pulp certificate
2132
hashivault_pki_cert_issue: # noqa: fqcn
2233
url: "{{ openbao_api_addr }}"

0 commit comments

Comments
 (0)