From 48bd378fda4db37b519742bdcf98b6a48f83b594 Mon Sep 17 00:00:00 2001 From: Mustapha Lansana Date: Tue, 27 May 2014 22:02:58 -0400 Subject: deploychef: make chef-solo templates for openstack services The deploychef package enables us to reconfigure an openstack installation at run-time. It does this with the help of chef-solo, by first creating a set of template files from openstack services' configuration files. The template files are then passed on to chef-solo at run-time. Finally, chef-solo recreates the services' configuration files from the template files at run-time; this enables us to reconfigure openstack services with dynamic run-time environment variables. This patch set consist of files with helper functions which enables deploychef to recreate the template files for the respective openstack services. Later on in this commit series, the files in this patch set will be deleted, because the functionality they provide will be provided by openstackchef class. Signed-off-by: Mustapha Lansana --- .../deploychef/files/conf-templates/heat-template.inc | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 meta-openstack/recipes-support/deploychef/files/conf-templates/heat-template.inc (limited to 'meta-openstack/recipes-support/deploychef/files/conf-templates/heat-template.inc') diff --git a/meta-openstack/recipes-support/deploychef/files/conf-templates/heat-template.inc b/meta-openstack/recipes-support/deploychef/files/conf-templates/heat-template.inc new file mode 100644 index 0000000..578d2e7 --- /dev/null +++ b/meta-openstack/recipes-support/deploychef/files/conf-templates/heat-template.inc @@ -0,0 +1,15 @@ +#Heat related configuration function(s) +heat-conf_chefsolo_template() { + file_name=$1 + if [ -e $file_name ]; then + sed "s/$DB_USER:/<%=node[:DB_USER]%>:/g" -i $file_name + sed "s/$DB_PASSWORD@/<%=node[:DB_PASSWORD]%>@/g" -i $file_name + sed "s/^auth_host =.*$/auth_host = <%=node[:CONTROLLER_IP]%> /" -i $file_name + sed "s/^admin_tenant_name =.*$/admin_tenant_name = <%=node[:SERVICE_TENANT_NAME]%> /" -i $file_name + sed "s/^admin_password =.*$/admin_password = <%=node[:ADMIN_PASSWORD]%> /" -i $file_name + sed "s/$CONTROLLER_IP/<%=node[:CONTROLLER_IP]%>/g" -i $file_name + sed "s/$CONTROLLER_HOST/<%=node[:CONTROLLER_HOST]%>/g" -i $file_name + mv $file_name $file_name$SUFFIX + fi +} + -- cgit v1.2.3-54-g00ecf