Skip to content

Commit af893d1

Browse files
committed
Support using local hashicorp consul/vault images
This requires an updated hashicorp collection.
1 parent 91fda15 commit af893d1

File tree

4 files changed

+64
-2
lines changed

4 files changed

+64
-2
lines changed

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/inventory/group_vars/all/vault

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,20 @@ seed_vault_pki_roles:
2727
organization: ["StackHPC"]
2828
ou: ["OpenStack"]
2929

30+
# Registry information for overcloud.
31+
overcloud_hashicorp_registry_url: "{{ stackhpc_docker_registry if stackhpc_sync_hashicorp_images | bool else '' }}"
32+
overcloud_hashicorp_registry_username: "{{ stackhpc_docker_registry_username if stackhpc_sync_hashicorp_images | bool else '' }}"
33+
overcloud_hashicorp_registry_password: "{{ stackhpc_docker_registry_password if stackhpc_sync_hashicorp_images | bool else '' }}"
34+
35+
# Overcloud Consul container image.
36+
overcloud_consul_docker_image: "{{ stackhpc_docker_registry ~ '/' if stackhpc_sync_hashicorp_images | bool else '' }}hashicorp/consul"
37+
3038
# Overcloud Consul container image tag.
3139
overcloud_consul_docker_tag: "1.16"
3240

41+
# Overcloud Vault container image.
42+
overcloud_vault_docker_image: "{{ stackhpc_docker_registry ~ '/' if stackhpc_sync_hashicorp_images | bool else '' }}hashicorp/vault"
43+
3344
# Overcloud Vault container image tag.
3445
overcloud_vault_docker_tag: "1.14"
3546

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: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,20 @@
1414
# Seed Vault PKI Roles definition
1515
# seed_vault_pki_roles: []
1616

17+
# Registry information for overcloud.
18+
# overcloud_hashicorp_registry_url:
19+
# overcloud_hashicorp_registry_username:
20+
# overcloud_hashicorp_registry_password:
21+
22+
# Overcloud Consul container image.
23+
# overcloud_consul_docker_image:
24+
1725
# Overcloud Consul container image tag.
1826
# overcloud_consul_docker_tag:
1927

28+
# Overcloud Vault container image.
29+
# overcloud_vault_docker_image:
30+
2031
# Overcloud Vault container image tag.
2132
# overcloud_vault_docker_tag:
2233

0 commit comments

Comments
 (0)