Include docker and undercloud environments first

When we deploy the undercloud, the command we use should include the
docker.yaml and undercloud.yaml environments earlier in the deployment
command so we can override the defaults later on.

Change-Id: Ic7dba7e548f85574cce2db23e3fec5c8ea761bb7
Related-Blueprint: containerized-undercloud
This commit is contained in:
Alex Schultz 2018-05-08 15:14:20 -06:00
parent dba64b6b70
commit 4c5b8c8742
2 changed files with 47 additions and 42 deletions

View File

@ -81,7 +81,11 @@ class TestUndercloudInstall(TestPluginV1):
'--local-ip=192.168.24.1/24',
'--templates=/usr/share/openstack-tripleo-heat-templates/',
'--roles-file=foo/roles.yaml',
'--heat-native', '-e', '/home/stack/foo.yaml', '-e',
'--heat-native', '-e',
'/usr/share/openstack-tripleo-heat-templates/environments/'
'docker.yaml', '-e',
'/usr/share/openstack-tripleo-heat-templates/environments/'
'undercloud.yaml', '-e', '/home/stack/foo.yaml', '-e',
'/usr/share/openstack-tripleo-heat-templates/environments/'
'services/ironic.yaml',
'-e',
@ -106,12 +110,8 @@ class TestUndercloudInstall(TestPluginV1):
'/usr/share/openstack-tripleo-heat-templates/environments/'
'services/undercloud-haproxy.yaml', '-e',
'/usr/share/openstack-tripleo-heat-templates/environments/'
'services/undercloud-keepalived.yaml', '-e',
'/usr/share/openstack-tripleo-heat-templates/environments/'
'docker.yaml', '-e',
'/usr/share/openstack-tripleo-heat-templates/environments/'
'undercloud.yaml', '--output-dir=/foo', '--cleanup',
'-e', '/foo/undercloud_parameters.yaml',
'services/undercloud-keepalived.yaml', '--output-dir=/foo',
'--cleanup', '-e', '/foo/undercloud_parameters.yaml',
'--log-file=/tmp/install-undercloud.log'])
@mock.patch('os.mkdir')
@ -235,7 +235,11 @@ class TestUndercloudInstall(TestPluginV1):
'--local-domain=localdomain',
'--local-ip=192.168.24.1/24',
'--templates=/usr/share/openstack-tripleo-heat-templates/',
'--heat-native', '-e', '/home/stack/foo.yaml', '-e',
'--heat-native', '-e',
'/usr/share/openstack-tripleo-heat-templates/environments/'
'docker.yaml', '-e',
'/usr/share/openstack-tripleo-heat-templates/environments/'
'undercloud.yaml', '-e', '/home/stack/foo.yaml', '-e',
'/usr/share/openstack-tripleo-heat-templates/'
'environments/services/masquerade-networks.yaml',
'-e',
@ -263,12 +267,8 @@ class TestUndercloudInstall(TestPluginV1):
'/usr/share/openstack-tripleo-heat-templates/environments/'
'services/undercloud-haproxy.yaml', '-e',
'/usr/share/openstack-tripleo-heat-templates/environments/'
'services/undercloud-keepalived.yaml', '-e',
'/usr/share/openstack-tripleo-heat-templates/environments/'
'docker.yaml', '-e',
'/usr/share/openstack-tripleo-heat-templates/environments/'
'undercloud.yaml', '--output-dir=/home/stack', '--cleanup',
'-e', '/home/stack/undercloud_parameters.yaml',
'services/undercloud-keepalived.yaml', '--output-dir=/home/stack',
'--cleanup', '-e', '/home/stack/undercloud_parameters.yaml',
'--log-file=/tmp/install-undercloud.log'])
@mock.patch('os.mkdir')
@ -293,7 +293,11 @@ class TestUndercloudInstall(TestPluginV1):
'--local-domain=localdomain',
'--local-ip=192.168.24.1/24',
'--templates=/usr/share/openstack-tripleo-heat-templates/',
'--heat-native', '-e', '/home/stack/foo.yaml', '-e',
'--heat-native', '-e',
'/usr/share/openstack-tripleo-heat-templates/environments/'
'docker.yaml', '-e',
'/usr/share/openstack-tripleo-heat-templates/environments/'
'undercloud.yaml', '-e', '/home/stack/foo.yaml', '-e',
'/usr/share/openstack-tripleo-heat-templates/environments/'
'services/ironic.yaml',
'-e',
@ -318,11 +322,8 @@ class TestUndercloudInstall(TestPluginV1):
'/usr/share/openstack-tripleo-heat-templates/environments/'
'services/undercloud-haproxy.yaml', '-e',
'/usr/share/openstack-tripleo-heat-templates/environments/'
'services/undercloud-keepalived.yaml', '-e',
'/usr/share/openstack-tripleo-heat-templates/environments/'
'docker.yaml', '-e',
'/usr/share/openstack-tripleo-heat-templates/environments/'
'undercloud.yaml', '--output-dir=/home/stack', '--cleanup',
'services/undercloud-keepalived.yaml',
'--output-dir=/home/stack', '--cleanup',
'-e', '/home/stack/undercloud_parameters.yaml',
'--debug', '--log-file=/tmp/install-undercloud.log'])
@ -346,7 +347,11 @@ class TestUndercloudInstall(TestPluginV1):
'--local-domain=localdomain',
'--local-ip=192.168.24.1/24',
'--templates=/usr/share/openstack-tripleo-heat-templates/',
'--heat-native', '-e', '/home/stack/foo.yaml', '-e',
'--heat-native', '-e',
'/usr/share/openstack-tripleo-heat-templates/environments/'
'docker.yaml', '-e',
'/usr/share/openstack-tripleo-heat-templates/environments/'
'undercloud.yaml', '-e', '/home/stack/foo.yaml', '-e',
'/usr/share/openstack-tripleo-heat-templates/environments/'
'services/ironic.yaml',
'-e',
@ -375,11 +380,8 @@ class TestUndercloudInstall(TestPluginV1):
'/usr/share/openstack-tripleo-heat-templates/environments/'
'services/undercloud-haproxy.yaml', '-e',
'/usr/share/openstack-tripleo-heat-templates/environments/'
'services/undercloud-keepalived.yaml', '-e',
'/usr/share/openstack-tripleo-heat-templates/environments/'
'docker.yaml', '-e',
'/usr/share/openstack-tripleo-heat-templates/environments/'
'undercloud.yaml', '--output-dir=/home/stack', '--cleanup',
'services/undercloud-keepalived.yaml',
'--output-dir=/home/stack', '--cleanup',
'-e', '/home/stack/undercloud_parameters.yaml',
'--log-file=/tmp/install-undercloud.log'])
@ -437,7 +439,11 @@ class TestUndercloudUpgrade(TestPluginV1):
'--local-ip=192.168.24.1/24',
'--templates=/usr/share/openstack-tripleo-heat-templates/',
'--upgrade',
'--heat-native', '-e', '/home/stack/foo.yaml', '-e',
'--heat-native', '-e',
'/usr/share/openstack-tripleo-heat-templates/environments/'
'docker.yaml', '-e',
'/usr/share/openstack-tripleo-heat-templates/environments/'
'undercloud.yaml', '-e', '/home/stack/foo.yaml', '-e',
'/usr/share/openstack-tripleo-heat-templates/environments/'
'services/ironic.yaml',
'-e',
@ -462,11 +468,8 @@ class TestUndercloudUpgrade(TestPluginV1):
'/usr/share/openstack-tripleo-heat-templates/environments/'
'services/undercloud-haproxy.yaml', '-e',
'/usr/share/openstack-tripleo-heat-templates/environments/'
'services/undercloud-keepalived.yaml', '-e',
'/usr/share/openstack-tripleo-heat-templates/environments/'
'docker.yaml', '-e',
'/usr/share/openstack-tripleo-heat-templates/environments/'
'undercloud.yaml', '--output-dir=/home/stack', '--cleanup',
'services/undercloud-keepalived.yaml',
'--output-dir=/home/stack', '--cleanup',
'-e', '/home/stack/undercloud_parameters.yaml',
'--log-file=/tmp/install-undercloud.log'])
@ -493,7 +496,11 @@ class TestUndercloudUpgrade(TestPluginV1):
'--local-ip=192.168.24.1/24',
'--templates=/usr/share/openstack-tripleo-heat-templates/',
'--upgrade',
'--heat-native', '-e', '/home/stack/foo.yaml', '-e',
'--heat-native', '-e',
'/usr/share/openstack-tripleo-heat-templates/environments/'
'docker.yaml', '-e',
'/usr/share/openstack-tripleo-heat-templates/environments/'
'undercloud.yaml', '-e', '/home/stack/foo.yaml', '-e',
'/usr/share/openstack-tripleo-heat-templates/environments/'
'services/ironic.yaml',
'-e',
@ -518,10 +525,7 @@ class TestUndercloudUpgrade(TestPluginV1):
'/usr/share/openstack-tripleo-heat-templates/environments/'
'services/undercloud-haproxy.yaml', '-e',
'/usr/share/openstack-tripleo-heat-templates/environments/'
'services/undercloud-keepalived.yaml', '-e',
'/usr/share/openstack-tripleo-heat-templates/environments/'
'docker.yaml', '-e',
'/usr/share/openstack-tripleo-heat-templates/environments/'
'undercloud.yaml', '--output-dir=/home/stack', '--cleanup',
'services/undercloud-keepalived.yaml',
'--output-dir=/home/stack', '--cleanup',
'-e', '/home/stack/undercloud_parameters.yaml',
'--debug', '--log-file=/tmp/install-undercloud.log'])

View File

@ -339,6 +339,11 @@ def prepare_undercloud_deploy(upgrade=False, no_validations=False,
deploy_args.append('--heat-container-image=%s'
% CONF['heat_container_image'])
# These should be loaded first so we can override all the bits later
deploy_args += [
"-e", os.path.join(tht_templates, "environments/docker.yaml"),
"-e", os.path.join(tht_templates, "environments/undercloud.yaml")]
_container_images_config(CONF, deploy_args, env_data)
if env_data['MasqueradeNetworks']:
@ -454,10 +459,6 @@ def prepare_undercloud_deploy(upgrade=False, no_validations=False,
u = CONF.get('deployment_user') or utils.get_deployment_user()
env_data['DeploymentUser'] = u
deploy_args += [
"-e", os.path.join(tht_templates, "environments/docker.yaml"),
"-e", os.path.join(tht_templates, "environments/undercloud.yaml")]
params_file = os.path.abspath(os.path.join(CONF['output_dir'],
'undercloud_parameters.yaml'))
deploy_args += ['--output-dir=%s' % CONF['output_dir']]