+if [ "$API_FQDN" != "None" ]; then
+ # Push api fqdn local ip to all /etc/hosts
+ if [[ "$jujuver" < "2" ]]; then
+ API_FQDN=$(juju get keystone | python -c "import yaml; import sys;\
+ print yaml.load(sys.stdin)['settings']['os-public-hostname']['value']")
+ else
+ API_FQDN=$(juju config keystone | python -c "import yaml; import sys;\
+ print yaml.load(sys.stdin)['settings']['os-public-hostname']['value']")
+ fi
+
+
+ KEYSTONEIP=$(keystoneIp)
+ juju run --all "if grep $API_FQDN /etc/hosts > /dev/null; then \
+ echo 'API FQDN already present'; \
+ else \
+ sudo sh -c 'echo $KEYSTONEIP $API_FQDN >> /etc/hosts'; \
+ echo 'API FQDN injected'; \
+ fi"
+
+ # remove this enhancement for heat that does not manage endpoints
+ juju run --service=heat "cp /etc/hosts /tmp/hosts ; \
+ grep -v $API_FQDN /tmp/hosts > /etc/hosts"
+
+ #change in jumphost as well as below commands will run on jumphost
+ if grep $API_FQDN /etc/hosts; then
+ echo 'API FQDN already present'
+ else
+ sudo sh -c "echo $KEYSTONEIP $API_FQDN >> /etc/hosts"
+ echo 'API FQDN injected'
+ fi
+fi
+
+# Create an load openrc