Merge "nodepool-builder: put container configs in /etc"

This commit is contained in:
Zuul 2020-03-17 17:50:12 +00:00 committed by Gerrit Code Review
commit 87db9b6ac6
4 changed files with 14 additions and 11 deletions

View File

@ -1,4 +1,4 @@
openstacksdk_config_dir: /home/nodepool/.config/openstack
openstacksdk_config_owner: nodepool
openstacksdk_config_group: nodepool
openstacksdk_config_dir: /etc/openstack
openstacksdk_config_owner: root
openstacksdk_config_group: root
openstacksdk_config_template: clouds/nodepool_clouds.yaml.j2

View File

@ -12,12 +12,10 @@ services:
- DEBUG=1
volumes:
# NOTE(ianw): for non-containerised builds the base roles
# (configure-openstacksdk) have always deployed the cloud config
# in ~nodepool/.config.
- /home/nodepool/.config/openstack:/etc/openstack:ro
# nodepool config
- /etc/nodepool:/etc/nodepool:ro
# openstacksdk config
- /etc/openstack:/etc/openstack:ro
# project-config
- /opt/project-config:/opt/project-config:ro
# dib temporary storage; see config in project-config

View File

@ -3,7 +3,7 @@
#
# This file is deployed to nodepool builder hosts as
#
# ~nodepool/.config/openstack/config/clouds.yaml
# {{ openstacksdk_config_dir }}/clouds.yaml
#
# and is used there to authenticate nodepool operations to clouds.
# The naming should correspond that used in nodepool configuration
@ -155,7 +155,7 @@ clouds:
api_timeout: 60
identity_api_version: 3
floating_ip_source: None
cacert: /home/nodepool/.config/openstack/limestone_cacert.pem
cacert: '{{ openstacksdk_config_dir }}/limestone_cacert.pem'
packethost:
regions:
- name: us-west-1

View File

@ -19,7 +19,12 @@ testinfra_hosts = ['nl01.openstack.org', 'nb01.openstack.org',
def test_clouds_yaml(host):
clouds_yaml = host.file('/home/nodepool/.config/openstack/clouds.yaml')
if host.backend.get_hostname().endswith('openstack.org'):
cfg_file = '/home/nodepool/.config/openstack/clouds.yaml'
else:
cfg_file = '/etc/openstack/clouds.yaml'
clouds_yaml = host.file(cfg_file)
assert clouds_yaml.exists
assert b'password' in clouds_yaml.content