Skip to content

Commit 89d69e1

Browse files
priteauAlex-Welsh
authored andcommitted
Support using local hashicorp consul/vault images
This requires stackhpc.hashicorp 2.4.0.
1 parent 43928d1 commit 89d69e1

File tree

6 files changed

+92
-3
lines changed

6 files changed

+92
-3
lines changed

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
@@ -797,12 +797,47 @@ stackhpc_pulp_distribution_container_ceph:
797797
state: present
798798
required: "{{ stackhpc_sync_ceph_images | bool }}"
799799

800+
# Whether to sync HashiCorp container images.
801+
stackhpc_sync_hashicorp_images: false
802+
803+
# List of HashiCorp container image repositories.
804+
stackhpc_pulp_repository_container_repos_hashicorp:
805+
- name: "hashicorp/consul"
806+
url: "https://registry-1.docker.io"
807+
policy: on_demand
808+
proxy_url: "{{ pulp_proxy_url }}"
809+
state: present
810+
include_tags: "{{ overcloud_consul_docker_tag }}"
811+
required: "{{ stackhpc_sync_hashicorp_images | bool }}"
812+
- name: "hashicorp/vault"
813+
url: "https://registry-1.docker.io"
814+
policy: on_demand
815+
proxy_url: "{{ pulp_proxy_url }}"
816+
state: present
817+
include_tags: "{{ overcloud_vault_docker_tag }}"
818+
required: "{{ stackhpc_sync_hashicorp_images | bool }}"
819+
820+
# List of HashiCorp container image distributions.
821+
stackhpc_pulp_distribution_container_hashicorp:
822+
- name: consul
823+
repository: hashicorp/consul
824+
base_path: hashicorp/consul
825+
state: present
826+
required: "{{ stackhpc_sync_hashicorp_images | bool }}"
827+
- name: vault
828+
repository: hashicorp/vault
829+
base_path: hashicorp/vault
830+
state: present
831+
required: "{{ stackhpc_sync_hashicorp_images | bool }}"
832+
800833
# List of container image repositories.
801834
stackhpc_pulp_repository_container_repos: >-
802835
{{ (stackhpc_pulp_repository_container_repos_kolla +
803-
stackhpc_pulp_repository_container_repos_ceph) | selectattr('required') }}
836+
stackhpc_pulp_repository_container_repos_ceph +
837+
stackhpc_pulp_repository_container_repos_hashicorp) | selectattr('required') }}
804838
805839
# List of container image distributions.
806840
stackhpc_pulp_distribution_container: >-
807841
{{ (stackhpc_pulp_distribution_container_kolla +
808-
stackhpc_pulp_distribution_container_ceph) | selectattr('required') }}
842+
stackhpc_pulp_distribution_container_ceph +
843+
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

0 commit comments

Comments
 (0)