Skip to content

Commit 341d18e

Browse files
committed
Fix backend API certificate generation
Some dependencies for generating backend API certificates were missing but were undetected because they were fulfilled by other vault playbooks run earlier during the deployment process. This was detected when playbook hosts were extended to include separate network hosts running some OpenStack services.
1 parent 3a33494 commit 341d18e

File tree

1 file changed

+32
-0
lines changed

1 file changed

+32
-0
lines changed

etc/kayobe/ansible/vault-generate-backend-tls.yml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,42 @@
11
---
2+
# Required for uri module to work with self-signed certificates and for systems to trust
3+
# the self-signed CA
4+
- name: Install CA on controllers
5+
hosts: controllers
6+
tasks:
7+
- name: Copy the intermediate CA
8+
copy:
9+
src: "{{ kayobe_env_config_path }}/vault/OS-TLS-ROOT.pem"
10+
dest: "{{ '/etc/pki/ca-trust/source/anchors/OS-TLS-ROOT.crt' if ansible_facts.os_family == 'RedHat' else '/usr/local/share/ca-certificates/OS-TLS-ROOT.crt' }}"
11+
mode: 0644
12+
become: true
13+
14+
- name: update system CA
15+
become: true
16+
shell: "{{ 'update-ca-trust' if ansible_facts.os_family == 'RedHat' else 'update-ca-certificates' }}"
17+
218
- name: Generate backend API certificates
319
hosts: controllers
420
vars:
521
vault_api_addr: "https://{{ kolla_internal_fqdn }}:8200"
622
vault_intermediate_ca_name: "OS-TLS-INT"
723
tasks:
24+
- name: Set a fact about the virtualenv on the remote system
25+
set_fact:
26+
virtualenv: "{{ ansible_python_interpreter | dirname | dirname }}"
27+
when:
28+
- ansible_python_interpreter is defined
29+
- not ansible_python_interpreter.startswith('/bin/')
30+
- not ansible_python_interpreter.startswith('/usr/bin/')
31+
32+
- name: Ensure Python hvac module is installed
33+
pip:
34+
name: hvac
35+
state: latest
36+
extra_args: "{% if pip_upper_constraints_file %}-c {{ pip_upper_constraints_file }}{% endif %}"
37+
virtualenv: "{{ virtualenv is defined | ternary(virtualenv, omit) }}"
38+
become: "{{ virtualenv is not defined }}"
39+
840
- name: Include Vault keys
941
include_vars:
1042
file: "{{ kayobe_env_config_path }}/vault/overcloud-vault-keys.json"

0 commit comments

Comments
 (0)