Skip to content

Commit 02a992d

Browse files
authored
Merge pull request #559 from stackhpc/multinode-tls
Support TLS & HCP Vault PKI in the multinode env
2 parents 4f98f7e + c0d3dbc commit 02a992d

File tree

7 files changed

+75
-1
lines changed

7 files changed

+75
-1
lines changed

doc/source/configuration/vault.rst

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,8 @@ Before beginning the deployment of vault for openstack internal TLS and backend
3636

3737
* Seed Node or a host to run the vault container on
3838
* Overcloud controller hosts to install second vault on
39+
* Ansible Galaxy dependencies installed: ``kayobe control host bootstrap``
40+
* Python dependencies installed: ``pip install -r kayobe-config/requirements.txt``
3941

4042
Deployment
4143
==========
@@ -197,7 +199,7 @@ Enable the required TLS variables in kayobe and kolla
197199
# Copy the self-signed CA into the kolla containers
198200
kolla_copy_ca_into_containers: "yes"
199201
# Use the following trust store within the container
200-
openstack_cacert: "{{ '/etc/pki/tls/certs/ca-bundle.crt' if os_distribution in ["centos", "rocky"] else '/etc/ssl/certs/ca-certificates.crt' }}"
202+
openstack_cacert: "{{ '/etc/pki/tls/certs/ca-bundle.crt' if os_distribution in ['centos', 'rocky'] else '/etc/ssl/certs/ca-certificates.crt' }}"
201203
202204
# Backend TLS config
203205
# Enable backend TLS

etc/kayobe/ansible/vault-deploy-barbican.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,13 @@
7777
debug:
7878
msg: "barbican role id is {{ barbican_role_id.id }}"
7979

80+
- name: Write barbican Approle ID to file if requested
81+
delegate_to: localhost
82+
copy:
83+
content: "{{ barbican_role_id.id }}"
84+
dest: "{{ stackhpc_barbican_role_id_file_path | default('~/barbican-role-id') }}"
85+
when: stackhpc_write_barbican_role_id_to_file | bool | default(false)
86+
8087
- name: Check if barbican Approle Secret ID is defined
8188
hashivault_approle_role_secret_list:
8289
url: "{{ vault_api_addr }}"

etc/kayobe/environments/ci-multinode/globals.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,12 @@ os_release: >-
5656
(lookup('pipe', '. /etc/os-release && echo $VERSION_ID') | trim | split('.') | first) if os_distribution == 'rocky' else
5757
'stream-8' }}
5858
###############################################################################
59+
# Hashicorp vault, Barbican, and TLS configuration
60+
61+
stackhpc_write_barbican_role_id_to_file: true
62+
stackhpc_barbican_role_id_file_path: "/tmp/barbican-role-id"
63+
64+
###############################################################################
5965

6066
# Avoid a reboot.
6167
disable_selinux_do_reboot: false

etc/kayobe/environments/ci-multinode/kolla.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,13 @@ kolla_enable_neutron_provider_networks: true
55
kolla_enable_ovn: true
66
kolla_enable_octavia: true
77
kolla_enable_magnum: true
8+
kolla_enable_barbican: true
9+
10+
# The multinode environment supports Backend and internal TLS , but it must be
11+
# enabled in the correct order. See
12+
# https://stackhpc-kayobe-config.readthedocs.io/en/stackhpc-yoga/configuration/vault.html
13+
# for details.
14+
# kolla_enable_tls_internal: true
815

916
# The multinode environment supports Manila but it is not enabled by default.
1017
# kolla_enable_manila: true
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# Example barbican config for vault integration
2+
[secretstore]
3+
namespace=barbican.secretstore.plugin
4+
enable_multiple_secret_stores=false
5+
enabled_secretstore_plugins=vault_plugin
6+
7+
[vault_plugin]
8+
vault_url = https://{{ kolla_internal_vip_address }}:8200
9+
use_ssl = True
10+
approle_role_id = {{ secrets_barbican_approle_role_id }}
11+
approle_secret_id = {{ secrets_barbican_approle_secret_id }}
12+
kv_mountpoint = barbican
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
{% raw %}
2+
frontend vault_front
3+
mode tcp
4+
option tcplog
5+
bind {{ kolla_internal_vip_address }}:8200
6+
default_backend vault_back
7+
8+
backend vault_back
9+
mode tcp
10+
option httpchk GET /v1/sys/health
11+
# https://www.vaultproject.io/api-docs/system/health
12+
# 200: initialized, unsealed, and active
13+
# 501: not initialised (required for bootstrapping)
14+
# 503: sealed (required for bootstrapping)
15+
http-check expect rstatus (200|501|503)
16+
17+
{% for host in groups['control'] %}
18+
{% set host_name = hostvars[host].ansible_facts.hostname %}
19+
{% set host_ip = 'api' | kolla_address(host) %}
20+
server {{ host_name }} {{ host_ip }}:8200 check check-ssl verify none inter 2000 rise 2 fall 5
21+
{% endfor %}
22+
{% endraw %}
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
############################################################################
2+
# This content is copied into globals.yml during automated setup, but cannot
3+
# exist during the initial configuration
4+
5+
# Internal TLS configuration
6+
# Copy the self-signed CA into the kolla containers
7+
kolla_copy_ca_into_containers: "yes"
8+
# Use the following trust store within the container
9+
openstack_cacert: "{{ '/etc/pki/tls/certs/ca-bundle.crt' if os_distribution in ['centos', 'rocky'] else '/etc/ssl/certs/ca-certificates.crt' }}"
10+
11+
# Backend TLS config
12+
# Enable backend TLS
13+
kolla_enable_tls_backend: "yes"
14+
15+
# If using RabbitMQ TLS:
16+
rabbitmq_enable_tls: "yes"
17+
18+
############################################################################

0 commit comments

Comments
 (0)