Skip to content

Commit eaad4bd

Browse files
authored
Merge pull request #570 from stackhpc/hashicorp-images
Support using local hashicorp consul/vault images
2 parents 6223b2d + a788859 commit eaad4bd

File tree

9 files changed

+109
-3
lines changed

9 files changed

+109
-3
lines changed

doc/source/configuration/release-train.rst

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,13 @@ Ceph container images
115115
By default, Ceph images are not synced from quay.io to the local Pulp. To sync
116116
these images, set ``stackhpc_sync_ceph_images`` to ``true``.
117117

118+
HashiCorp container images
119+
--------------------------
120+
121+
By default, HashiCorp images (Consul and Vault) are not synced from Docker Hub
122+
to the local Pulp. To sync these images, set ``stackhpc_sync_hashicorp_images``
123+
to ``true``.
124+
118125
Usage
119126
=====
120127

doc/source/configuration/vault.rst

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,11 @@ Before beginning the deployment of vault for openstack internal TLS and backend
3939
* Ansible Galaxy dependencies installed: ``kayobe control host bootstrap``
4040
* Python dependencies installed: ``pip install -r kayobe-config/requirements.txt``
4141

42+
By default, Consul and Vault images are not synced from Docker Hub to the local
43+
Pulp. To sync these images, set ``stackhpc_sync_hashicorp_images`` to ``true``.
44+
The Vault deployment configuration will be automatically updated to pull images
45+
from Pulp.
46+
4247
Deployment
4348
==========
4449

etc/kayobe/ansible/requirements.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ collections:
55
- name: stackhpc.pulp
66
version: 0.4.1
77
- name: stackhpc.hashicorp
8-
version: 2.3.0
8+
version: 2.4.0
99
roles:
1010
- src: stackhpc.vxlan
1111
- name: ansible-lockdown.rhel8_cis

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

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,10 +60,15 @@
6060
- import_role:
6161
name: stackhpc.hashicorp.vault
6262
vars:
63+
hashicorp_registry_url: "{{ overcloud_hashicorp_registry_url }}"
64+
hashicorp_registry_username: "{{ overcloud_hashicorp_registry_username }}"
65+
hashicorp_registry_password: "{{ overcloud_hashicorp_registry_password }}"
66+
consul_docker_image: "{{ overcloud_consul_docker_image }}"
6367
consul_docker_tag: "{{ overcloud_consul_docker_tag }}"
6468
vault_config_dir: "/opt/kayobe/vault"
6569
vault_cluster_name: "overcloud"
6670
vault_ca_cert: "{{ '/etc/pki/tls/certs/ca-bundle.crt' if ansible_facts.os_family == 'RedHat' else '/usr/local/share/ca-certificates/OS-TLS-ROOT.crt' }}"
71+
vault_docker_image: "{{ overcloud_vault_docker_image }}"
6772
vault_docker_tag: "{{ overcloud_vault_docker_tag }}"
6873
vault_tls_cert: "{% if kolla_internal_fqdn != kolla_internal_vip_address %}{{ kolla_internal_fqdn }}{% else %}overcloud{% endif %}.crt"
6974
vault_tls_key: "{% if kolla_internal_fqdn != kolla_internal_vip_address %}{{ kolla_internal_fqdn }}{% else %}overcloud{% endif %}.key"

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

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,14 @@
3636
- import_role:
3737
name: stackhpc.hashicorp.vault
3838
vars:
39+
hashicorp_registry_url: "{{ seed_hashicorp_registry_url }}"
40+
hashicorp_registry_username: "{{ seed_hashicorp_registry_username }}"
41+
hashicorp_registry_password: "{{ seed_hashicorp_registry_password }}"
42+
consul_docker_image: "{{ seed_consul_docker_image }}"
3943
consul_docker_tag: "{{ seed_consul_docker_tag }}"
4044
vault_config_dir: "/opt/kayobe/vault"
4145
vault_cluster_name: "seed"
46+
vault_docker_image: "{{ seed_vault_docker_image }}"
4247
vault_docker_tag: "{{ seed_vault_docker_tag }}"
4348
vault_write_keys_file: true
4449
vault_write_keys_file_path: "{{ kayobe_env_config_path }}/vault/seed-vault-keys.json"

etc/kayobe/inventory/group_vars/all/vault

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,20 @@
11
###############################################################################
22
# Hashicorp Vault deployment configuration.
33

4+
# Registry information for seed.
5+
seed_hashicorp_registry_url: "{{ stackhpc_docker_registry if stackhpc_sync_hashicorp_images | bool else '' }}"
6+
seed_hashicorp_registry_username: "{{ stackhpc_docker_registry_username if stackhpc_sync_hashicorp_images | bool else '' }}"
7+
seed_hashicorp_registry_password: "{{ stackhpc_docker_registry_password if stackhpc_sync_hashicorp_images | bool else '' }}"
8+
9+
# Seed Consul container image.
10+
seed_consul_docker_image: "{{ stackhpc_docker_registry ~ '/' if stackhpc_sync_hashicorp_images | bool else '' }}hashicorp/consul"
11+
412
# Seed Consul container image tag.
513
seed_consul_docker_tag: "1.16"
614

15+
# Seed Vault container image.
16+
seed_vault_docker_image: "{{ stackhpc_docker_registry ~ '/' if stackhpc_sync_hashicorp_images | bool else '' }}hashicorp/vault"
17+
718
# Seed Vault container image tag.
819
seed_vault_docker_tag: "1.14"
920

@@ -27,9 +38,20 @@ seed_vault_pki_roles:
2738
organization: ["StackHPC"]
2839
ou: ["OpenStack"]
2940

41+
# Registry information for overcloud.
42+
overcloud_hashicorp_registry_url: "{{ stackhpc_docker_registry if stackhpc_sync_hashicorp_images | bool else '' }}"
43+
overcloud_hashicorp_registry_username: "{{ stackhpc_docker_registry_username if stackhpc_sync_hashicorp_images | bool else '' }}"
44+
overcloud_hashicorp_registry_password: "{{ stackhpc_docker_registry_password if stackhpc_sync_hashicorp_images | bool else '' }}"
45+
46+
# Overcloud Consul container image.
47+
overcloud_consul_docker_image: "{{ stackhpc_docker_registry ~ '/' if stackhpc_sync_hashicorp_images | bool else '' }}hashicorp/consul"
48+
3049
# Overcloud Consul container image tag.
3150
overcloud_consul_docker_tag: "1.16"
3251

52+
# Overcloud Vault container image.
53+
overcloud_vault_docker_image: "{{ stackhpc_docker_registry ~ '/' if stackhpc_sync_hashicorp_images | bool else '' }}hashicorp/vault"
54+
3355
# Overcloud Vault container image tag.
3456
overcloud_vault_docker_tag: "1.14"
3557

etc/kayobe/pulp.yml

Lines changed: 37 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1217,12 +1217,47 @@ stackhpc_pulp_distribution_container_ceph:
12171217
state: present
12181218
required: "{{ stackhpc_sync_ceph_images | bool }}"
12191219

1220+
# Whether to sync HashiCorp container images.
1221+
stackhpc_sync_hashicorp_images: false
1222+
1223+
# List of HashiCorp container image repositories.
1224+
stackhpc_pulp_repository_container_repos_hashicorp:
1225+
- name: "hashicorp/consul"
1226+
url: "https://registry-1.docker.io"
1227+
policy: on_demand
1228+
proxy_url: "{{ pulp_proxy_url }}"
1229+
state: present
1230+
include_tags: "{{ overcloud_consul_docker_tag }}"
1231+
required: "{{ stackhpc_sync_hashicorp_images | bool }}"
1232+
- name: "hashicorp/vault"
1233+
url: "https://registry-1.docker.io"
1234+
policy: on_demand
1235+
proxy_url: "{{ pulp_proxy_url }}"
1236+
state: present
1237+
include_tags: "{{ overcloud_vault_docker_tag }}"
1238+
required: "{{ stackhpc_sync_hashicorp_images | bool }}"
1239+
1240+
# List of HashiCorp container image distributions.
1241+
stackhpc_pulp_distribution_container_hashicorp:
1242+
- name: consul
1243+
repository: hashicorp/consul
1244+
base_path: hashicorp/consul
1245+
state: present
1246+
required: "{{ stackhpc_sync_hashicorp_images | bool }}"
1247+
- name: vault
1248+
repository: hashicorp/vault
1249+
base_path: hashicorp/vault
1250+
state: present
1251+
required: "{{ stackhpc_sync_hashicorp_images | bool }}"
1252+
12201253
# List of container image repositories.
12211254
stackhpc_pulp_repository_container_repos: >-
12221255
{{ (stackhpc_pulp_repository_container_repos_kolla +
1223-
stackhpc_pulp_repository_container_repos_ceph) | selectattr('required') }}
1256+
stackhpc_pulp_repository_container_repos_ceph +
1257+
stackhpc_pulp_repository_container_repos_hashicorp) | selectattr('required') }}
12241258
12251259
# List of container image distributions.
12261260
stackhpc_pulp_distribution_container: >-
12271261
{{ (stackhpc_pulp_distribution_container_kolla +
1228-
stackhpc_pulp_distribution_container_ceph) | selectattr('required') }}
1262+
stackhpc_pulp_distribution_container_ceph +
1263+
stackhpc_pulp_distribution_container_hashicorp) | selectattr('required') }}

etc/kayobe/vault.yml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,20 @@
22
###############################################################################
33
# Hashicorp Vault deployment configuration.
44

5+
# Registry information for seed.
6+
# seed_hashicorp_registry_url:
7+
# seed_hashicorp_registry_username:
8+
# seed_hashicorp_registry_password:
9+
10+
# Seed Consul container image.
11+
# seed_consul_docker_image:
12+
513
# Seed Consul container image tag.
614
# seed_consul_docker_tag:
715

16+
# Seed Vault container image.
17+
# seed_vault_docker_image:
18+
819
# Seed Vault container image tag.
920
# seed_vault_docker_tag:
1021

@@ -14,9 +25,20 @@
1425
# Seed Vault PKI Roles definition
1526
# seed_vault_pki_roles: []
1627

28+
# Registry information for overcloud.
29+
# overcloud_hashicorp_registry_url:
30+
# overcloud_hashicorp_registry_username:
31+
# overcloud_hashicorp_registry_password:
32+
33+
# Overcloud Consul container image.
34+
# overcloud_consul_docker_image:
35+
1736
# Overcloud Consul container image tag.
1837
# overcloud_consul_docker_tag:
1938

39+
# Overcloud Vault container image.
40+
# overcloud_vault_docker_image:
41+
2042
# Overcloud Vault container image tag.
2143
# overcloud_vault_docker_tag:
2244

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
features:
3+
- |
4+
Adds support for synchronising HashiCorp Consul and Vault images to a local
5+
Pulp registry.

0 commit comments

Comments
 (0)