#!/bin/sh

set -e

. ./osinstallrc

pkgos-fix-config-default /etc/heat/heat.conf DEFAULT convergence_engine false
pkgos-fix-config-default /etc/heat/heat.conf DEFAULT stack_scheduler_hints true
pkgos-fix-config-default /etc/heat/heat.conf DEFAULT hidden_stack_tags hidden
pkgos-fix-config-default /etc/heat/heat.conf DEFAULT encrypt_parameters_and_properties true

pkgos-fix-config-default /etc/heat/heat.conf eventlet_opts client_socket_timeout 120

pkgos-fix-config-default /etc/heat/heat.conf oslo_messaging_notifications driver messagingv2

pkgos-fix-config-default /etc/heat/heat.conf trustee auth_type password
pkgos-fix-config-default /etc/heat/heat.conf trustee auth_url http://192.168.100.2:35357
pkgos-fix-config-default /etc/heat/heat.conf trustee username admin
pkgos-fix-config-default /etc/heat/heat.conf trustee password ${RC_KEYSTONE_ADMINPASS}
pkgos-fix-config-default /etc/heat/heat.conf trustee user_domain_name default

pkgos-fix-config-default /etc/heat/heat.conf clients_keystone auth_uri http://192.168.100.2:5000

pkgos-fix-config-default /etc/heat/heat.conf DEFAULT heat_metadata_server_url http://192.168.100.2:8000
pkgos-fix-config-default /etc/heat/heat.conf DEFAULT heat_waitcondition_server_url http://192.168.100.2:8000/v1/waitcondition

pkgos-fix-config-default /etc/heat/heat.conf DEFAULT stack_domain_admin = default
pkgos-fix-config-default /etc/heat/heat.conf DEFAULT stack_domain_admin_password ${RC_KEYSTONE_ADMINPASS}
pkgos-fix-config-default /etc/heat/heat.conf DEFAULT stack_user_domain_name = admin

for i in /etc/init.d/heat* ; do
	$i stop
	$i start
done
