Files
tripleo-quickstart-extras/roles/overcloud-deploy/templates/overcloud-deploy-post.sh.j2
Sandeep Yadav 805a2192ed Modify overcloud-deploy to support multiple stacks
To make overcloud-deploy role support deployment of multiple overcloud
stacks using a single undercloud node - we have generalized the vars
for stack name and removed hardcoding on "overcloud" name.

We also created a new playbook which install two overcloud stack -
overcloud and overcloud-two.

we also created j2 version of deploy and post-deploy script for
overcloud-two stack.

Intention is to create a new ci periodic job which test multi overcloud
stack deployment, The new ci job will not be executed upstream but 
rather in periodic only.

Change-Id: I353a0497cb4d44f82806381ee0a33b978c86be5f
2020-12-04 15:11:11 +00:00

59 lines
1.5 KiB
Django/Jinja

#!/bin/sh
set -eux
### --start_docs
## Post overcloud deployment steps
## ===============================
## * Prepare Your Environment.
## ::
{% if release in ['mitaka', 'newton', 'ocata', 'pike', 'queens', 'rocky', 'stein'] -%}
HOSTFILE=/etc/hosts
{% endif -%}
## * Source in the undercloud credentials.
## ::
. {{ working_dir }}/stackrc
{% if release in ['mitaka', 'newton', 'ocata', 'pike', 'queens', 'rocky', 'stein'] -%}
## * Remove any old overcloud host entries from `/etc/hosts`.
## ::
sudo sed -i '/^## BEGIN OVERCLOUD HOSTS/,/^## END OVERCLOUD HOSTS/ d' $HOSTFILE
## * Add overcloud hosts to `/etc/hosts`.
## ::
cat <<EOF | sudo tee -a $HOSTFILE
## BEGIN OVERCLOUD HOSTS #nodocs
$(openstack stack output show {{ stack_name }} HostsEntry -f value -c output_value)
{% if enable_pacemaker|bool and release == 'mitaka' %}
$(openstack stack output show {{ stack_name }} PublicVip \
-f value -c output_value) overcloud-public-vip
{% endif %}
## END OVERCLOUD HOSTS #nodocs
EOF
{% endif -%}
## * Create the `heat_stack_owner` role if it doesn't already exist.
## ::
if openstack stack output show {{ stack_name }} EnabledServices \
-f value -c output_value | grep -q keystone; then
## * Source in the {{ stack_name }} credentials.
## ::
. {{ working_dir }}/{{ stack_name }}rc
if ! openstack role show heat_stack_owner > /dev/null 2>&1; then
openstack role create heat_stack_owner
openstack role add --project admin --user admin heat_stack_owner
fi
fi
### --stop_docs