From 44b1f514191c949f3534463441b50932e2a89709 Mon Sep 17 00:00:00 2001 From: Florian Fuchs Date: Wed, 17 Oct 2018 14:15:15 +0200 Subject: [PATCH] Create default deployment plan Currently no default plan is created during a container-based undercloud deployment. This patch creates a default deployment plan if both of two conditions apply: - The /usr/share/openstack-tripleo-heat-templates directory exists (We need the templates to create the plan) - There is no container named `overcloud` in swift yet (If a deployment is run more than once we don't want to recreate the default plan) Closes-Bug: #1798590 Change-Id: Id03631432b1fedd75ee3ddba67bfe7d5d6049a07 --- extraconfig/post_deploy/undercloud_post.sh | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/extraconfig/post_deploy/undercloud_post.sh b/extraconfig/post_deploy/undercloud_post.sh index 6e84e42f13..6139bd9437 100755 --- a/extraconfig/post_deploy/undercloud_post.sh +++ b/extraconfig/post_deploy/undercloud_post.sh @@ -6,6 +6,7 @@ ln -sf /etc/puppet/hiera.yaml /etc/hiera.yaml HOMEDIR="$homedir" USERNAME=`ls -ld $HOMEDIR | awk {'print $3'}` GROUPNAME=`ls -ld $HOMEDIR | awk {'print $4'}` +THT_DIR="/usr/share/openstack-tripleo-heat-templates" # WRITE OUT STACKRC touch $HOMEDIR/stackrc @@ -138,6 +139,13 @@ if [ "$(hiera mistral_api_enabled)" = "true" ]; then openstack workflow env create $TMP_MISTRAL_ENV fi + # Create the default deployment plan from /usr/share/openstack-tripleo-heat-templates + # but only if there is no overcloud container in swift yet. + if [ -d "$THT_DIR" ] && ! openstack container list -c Name -f value | grep -qe "^overcloud$"; then + echo Create default deployment plan + openstack workflow execution create tripleo.plan_management.v1.create_deployment_plan '{"container": "overcloud", "use_default_templates": true}' + fi + if [ "$(hiera tripleo_validations_enabled)" = "true" ]; then echo Execute copy_ssh_key validations openstack workflow execution create tripleo.validations.v1.copy_ssh_key