tripleo-quickstart-extras/roles/overcloud-deploy/templates/overcloud-deploy-post.sh.j2

50 lines
1.0 KiB
Django/Jinja

#!/bin/sh
set -eux
### --start_docs
## Post overcloud deployment steps
## ===============================
## * Prepare Your Environment.
## ::
HOSTFILE=/etc/hosts
## * Source in the undercloud credentials.
## ::
. {{ working_dir }}/stackrc
## * 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
$(heat output-show -F raw overcloud HostsEntry)
{% if enable_pacemaker|bool %}
$(heat output-show -F raw overcloud PublicVip) overcloud-public-vip
{% endif %}
## END OVERCLOUD HOSTS #nodocs
EOF
## * Source in the overcloud credentials.
## ::
. {{ working_dir }}/overcloudrc
## * Create the `heat_stack_owner` role if it doesn't already exist.
## ::
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
### --stop_docs