A consumer gets a running single-node OpenBao server on integrated raft storage, listening on TLS they supply, left uninitialised and sealed. The role installs the pinned 2.7.3 release tarball, checked by get_url against the sha256 of each architecture from the release's checksums.txt (its GPG signature checks out against OpenBao's release key). It creates its own system user, data directory, configuration and sandboxed unit: Type=notify, SIGINT stop, MemorySwapMax=0 instead of mlock, an empty capability set, ProtectSystem=strict with the data directory writable, and ExecReload sending SIGHUP. The directive set was tried against the real binary under systemd before it was kept. TLS certificate, key and CA paths are required unless openbao_tls_disable is true, which warns; validation fails before any change when a file is missing, and the role checks the service user can read the key and certificate before writing the config. It reads its seal status over https://127.0.0.1 validated against the CA file, so an address other than a wildcard or loopback gets a second loopback listener. The tasks are split by job (validate, prereqs, install, configure, seal_status) so the init, unseal, audit and update work can reuse them. Refs: #536 Assisted-by: Claude Code
35 lines
1.1 KiB
YAML
35 lines
1.1 KiB
YAML
---
|
|
# The download and the sha256 pick depend on the CPU architecture; a play with gather_facts off
|
|
# has none, so the smallest subset is gathered here.
|
|
- name: Gather the architecture fact
|
|
ansible.builtin.setup:
|
|
gather_subset: [min]
|
|
when: ansible_facts.architecture is undefined
|
|
tags: [openbao, always]
|
|
|
|
- name: Map the architecture to the release name
|
|
ansible.builtin.set_fact:
|
|
__openbao_arch: "{{ {'x86_64': 'amd64', 'aarch64': 'arm64'}.get(ansible_facts.architecture, ansible_facts.architecture) }}"
|
|
tags: [openbao, always]
|
|
|
|
- name: Validate the role inputs
|
|
ansible.builtin.import_tasks: validate.yml
|
|
tags: [openbao, always]
|
|
|
|
- name: Include prerequisites
|
|
ansible.builtin.include_tasks: prereqs.yml
|
|
tags: [openbao, prereqs, always]
|
|
|
|
- name: Install OpenBao if missing
|
|
ansible.builtin.include_tasks: install.yml
|
|
when: not __openbao_installed
|
|
tags: [openbao, install]
|
|
|
|
- name: Configure and start OpenBao
|
|
ansible.builtin.include_tasks: configure.yml
|
|
tags: [openbao, configure, health]
|
|
|
|
- name: Read the seal status
|
|
ansible.builtin.include_tasks: seal_status.yml
|
|
tags: [openbao, configure, health]
|