From 98e1afbc185a7f87427860f4273a7285e5b6407e Mon Sep 17 00:00:00 2001 From: Mustapha Lansana Date: Tue, 27 May 2014 22:02:55 -0400 Subject: deploychef: makes chef-solo templates from openstack conf files The current openstack build bakes a number of variables into openstack services' configuration files at build-time. This makes it impossible to deploy an openstack image built for one run-time environment into a different run-time environment. The deploychef package uses chef-solo to enable the re-use of an openstack image in different run-time environments. The attached patch set is deploychef package recipe and init script files. The script deploychef.init gives us the ability to make a copy of the postinstall script before they are tainted. This enables us to create chef-solo templates out of the untainted postinstall scripts. The template files are then used to recreate the postinstall script whenever the stack needs to be reconfigured at run-time. Signed-off-by: Mustapha Lansana --- .../recipes-support/deploychef/files/deploychef.inc | 16 ++++++++++++++++ .../recipes-support/deploychef/files/deploychef.init | 11 +++++++++++ 2 files changed, 27 insertions(+) create mode 100644 meta-openstack/recipes-support/deploychef/files/deploychef.inc create mode 100644 meta-openstack/recipes-support/deploychef/files/deploychef.init (limited to 'meta-openstack/recipes-support/deploychef/files') diff --git a/meta-openstack/recipes-support/deploychef/files/deploychef.inc b/meta-openstack/recipes-support/deploychef/files/deploychef.inc new file mode 100644 index 0000000..65ea2ca --- /dev/null +++ b/meta-openstack/recipes-support/deploychef/files/deploychef.inc @@ -0,0 +1,16 @@ +#These variables are not defined in the services +#We define them here with the option for them to +#be overwritten in the future +#Nova package name, see nova recipe +SERVICE_USER ?= "nova" +#Swift test.conf +ADMIN_USER ?= "admin" +#Neutron neutron.conf +DEMO_USER ?= "demo" +DEMO_PASSWORD ?= "password" +#Use in ceilometer, openrc (nova& keystone) +OS_USERNAME ?= "admin" +OS_TENANT_NAME ?= "admin" +OS_PASSWORD ?= "password" +POSTINSTS_DIR ?= "rpm-postinsts" + diff --git a/meta-openstack/recipes-support/deploychef/files/deploychef.init b/meta-openstack/recipes-support/deploychef/files/deploychef.init new file mode 100644 index 0000000..b456e35 --- /dev/null +++ b/meta-openstack/recipes-support/deploychef/files/deploychef.init @@ -0,0 +1,11 @@ +#!/bin/bash +#After this script runs, chefsolo postinsts templates +#script will all be in chefsolo default templates directory +i=%DEPLOYCHEF_ROOT_DIR%/generate-templates +if [ -f $i ] && $i; then + echo "Chefsolo templates made successfully" + rm -f /etc/rcS.d/S96deploychef + rm -f $i +else + echo "ERROR: $i failed." +fi -- cgit v1.2.3-54-g00ecf