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
This commit is contained in:
Florian Fuchs 2018-10-17 14:15:15 +02:00
parent 50eb9cfc90
commit 44b1f51419

View File

@ -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