Files
Kamino/roles/openbao/molecule/default/tasks/failed_run.yml
T
Defame1297 7511d40ff8
Build / build (pull_request) Successful in 21s
Lint / renovate-config (pull_request) Successful in 4s
Molecule / select (pull_request) Successful in 3s
Lint / lint (pull_request) Successful in 5m20s
Molecule / scenarios (pull_request) Successful in 37m31s
Molecule / Result (pull_request) Successful in 1s
fix(openbao): follow TLS symlinks and keep :: on one listener
Go opens a :: listener dual-stack, so it already serves 127.0.0.1 and a
second loopback listener failed to bind with "address already in use".
:: again gets no loopback listener.

The TLS file checks did not follow symlinks, so a certbot-style live/
path was refused as not a regular file; the stat now follows them, and
the scenario reaches its certificate and key through symlinks.

Also:
- an owner or group with no name gives the readability message, not a
  templating error
- openbao_port and openbao_cluster_port must be 1024 or higher: the
  unit grants no capability to bind a lower port
- SystemCallErrorNumber=EPERM, so a filtered syscall fails instead of
  killing the server with SIGSYS
- a warning when the installed binary differs from openbao_version,
  since main does not change an installed binary
- the TLS file inputs are type path in the argument spec

Refs: #536
Assisted-by: Claude Code
2026-12-06 22:51:40 +00:00

41 lines
2.8 KiB
YAML

---
# One failing run: runs the main entry point with the inputs of the case and asserts that the
# expected message, not something else, stopped it. Input: openbao_test_case (name, vars,
# expect). Task vars cannot come from a template as a whole, so each input a case may change is
# passed with its scenario value as the default.
- name: "Run the role, case {{ openbao_test_case.name }}"
block:
- name: "Include the role, case {{ openbao_test_case.name }}"
ansible.builtin.include_role:
name: mortis.kamino.openbao
vars:
openbao_version: "{{ openbao_test_case.vars.openbao_version | default(openbao_test_defaults.openbao_version) }}"
openbao_sha256: "{{ openbao_test_case.vars.openbao_sha256 | default(openbao_test_defaults.openbao_sha256) }}"
openbao_bin_path: "{{ openbao_test_case.vars.openbao_bin_path | default('/usr/local/bin/bao') }}"
openbao_listen_address: "{{ openbao_test_case.vars.openbao_listen_address | default('0.0.0.0') }}"
openbao_port: "{{ openbao_test_case.vars.openbao_port | default(8200) }}"
openbao_cluster_port: "{{ openbao_test_case.vars.openbao_cluster_port | default(8201) }}"
openbao_node_id: "{{ openbao_test_case.vars.openbao_node_id | default(inventory_hostname) }}"
openbao_cluster_addr: "{{ openbao_test_case.vars.openbao_cluster_addr | default('https://' ~ inventory_hostname ~ ':8201') }}"
openbao_tls_cert_file: "{{ openbao_test_case.vars.openbao_tls_cert_file | default(openbao_test_tls_dir ~ '/live/server.crt') }}"
openbao_tls_key_file: "{{ openbao_test_case.vars.openbao_tls_key_file | default(openbao_test_tls_dir ~ '/live/server.key') }}"
openbao_tls_ca_file: "{{ openbao_test_case.vars.openbao_tls_ca_file | default(openbao_test_tls_dir ~ '/ca.crt') }}"
openbao_tls_min_version: "{{ openbao_test_case.vars.openbao_tls_min_version | default('tls12') }}"
# Only reached when the include returned. The message must not contain the expected
# text, so the rescue below cannot mistake it for the failure under test.
- name: "Fail because the include returned, case {{ openbao_test_case.name }}"
ansible.builtin.fail:
msg: The role accepted the input
rescue:
# A failed loop task reports its message per item.
- name: "The expected failure stopped the run, case {{ openbao_test_case.name }}"
vars:
openbao_test_messages: >-
{{ (ansible_failed_result.msg | default('')) ~ ' '
~ (ansible_failed_result.results | default([]) | map(attribute='msg', default='') | join(' ')) }}
ansible.builtin.assert:
that: openbao_test_case.expect in openbao_test_messages
fail_msg: "Expected '{{ openbao_test_case.expect }}', got: {{ openbao_test_messages }}"
quiet: true