Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion doc/source/configuration/openbao.rst
Original file line number Diff line number Diff line change
Expand Up @@ -494,7 +494,7 @@ To enable TLS for Pulp we first need to generate the certificates and the procee

.. code-block::
kayobe seed service reconfigure -t seed-deploy-containers -kt none
kayobe seed service deploy -t seed-deploy-containers -kt none
5. Set CA for docker registry

Expand Down
11 changes: 11 additions & 0 deletions etc/kayobe/ansible/pulp/pulp-generate-certificate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,17 @@
file: "{{ kayobe_env_config_path }}/openbao/seed-openbao-keys.json"
name: openbao_keys

- name: Check OpenBao seal status
ansible.builtin.uri:
url: "{{ openbao_api_addr }}/v1/sys/seal-status"
return_content: true
Comment on lines +21 to +23
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

To make this task more robust, it's good practice to explicitly check for a successful HTTP status code. This ensures that the playbook fails with a clear error if the OpenBao API is available but returns an unexpected status (e.g., a server error), rather than failing at the next task with a less obvious message.

      ansible.builtin.uri:
        url: "{{ openbao_api_addr }}/v1/sys/seal-status"
        return_content: true
        status_code: 200

register: openbao_seal_status

- name: Assert that OpenBao is unsealed
ansible.builtin.assert:
that: not openbao_seal_status.json.sealed
fail_msg: "OpenBao is sealed. Please unseal it before continuing."

- name: Issue Pulp certificate
hashivault_pki_cert_issue: # noqa: fqcn
url: "{{ openbao_api_addr }}"
Expand Down
Loading