summaryrefslogtreecommitdiffstats
path: root/meta-openstack/recipes-devtools/python/python-heat_git.bb
diff options
context:
space:
mode:
authorMustapha Lansana <Mustapha.Lansana@windriver.com>2014-07-30 21:36:33 -0400
committerBruce Ashfield <bruce.ashfield@windriver.com>2014-09-26 09:09:22 -0400
commitd42684ccde8f2dcd1fea0fc1f2ec7df6c89a0ce6 (patch)
tree686853037adde6488749d0a9adb26ec8d9242804 /meta-openstack/recipes-devtools/python/python-heat_git.bb
parent2b726dacf1d2213c0a5ebc01f1db4f0caa8d06d5 (diff)
downloadmeta-cloud-services-d42684ccde8f2dcd1fea0fc1f2ec7df6c89a0ce6.tar.gz
openstack: add support for openstackchef class to services
Openstackchef enables us to recreate configuration files for services in an openstack installation. It does this by creating template file(s) out of configuration file(s) exposed to the class by services. The following services are inheriting the openstack class and then exposing a set of configuration files to the class. These services expose their configuration files to openstackchef by assigning them to the variable CHEF_SERVICES_CONF_FILES. The files are assumend to have been installed in the image directory under the service's WORKDIR. At build-time, openstackchef makes chef-solo templates out of the registered files. And at run-time, the deploychef package makes a call to chef-solo, which in-turn use the template files to recreate the registered configuration files. For legacy reasons, the string OPENSTACKCHEF_ENABLED is defined in openstackchef class, but it can be overwritten in a .bb, .class, .bbappend or local.conf file to an empty string when openstackchef support is not desired. This enables all of these services to be built without openstackchef support. In addition, it prevents the recipes from substituting the placeholders in their configuration files when inheriting openstackchef. Signed-off-by: Mustapha Lansana <Mustapha.Lansana@windriver.com>
Diffstat (limited to 'meta-openstack/recipes-devtools/python/python-heat_git.bb')
-rw-r--r--meta-openstack/recipes-devtools/python/python-heat_git.bb36
1 files changed, 20 insertions, 16 deletions
diff --git a/meta-openstack/recipes-devtools/python/python-heat_git.bb b/meta-openstack/recipes-devtools/python/python-heat_git.bb
index b094a4c..5c73b99 100644
--- a/meta-openstack/recipes-devtools/python/python-heat_git.bb
+++ b/meta-openstack/recipes-devtools/python/python-heat_git.bb
@@ -71,25 +71,25 @@ do_install_append() {
71 install -d ${HEAT_CONF_DIR}/environment.d 71 install -d ${HEAT_CONF_DIR}/environment.d
72 install -m 600 ${TEMPLATE_CONF_DIR}/environment.d/* ${HEAT_CONF_DIR}/environment.d 72 install -m 600 ${TEMPLATE_CONF_DIR}/environment.d/* ${HEAT_CONF_DIR}/environment.d
73 install -m 664 ${TEMPLATE_CONF_DIR}/api-paste.ini ${HEAT_CONF_DIR} 73 install -m 664 ${TEMPLATE_CONF_DIR}/api-paste.ini ${HEAT_CONF_DIR}
74 if [ -z "${OPENSTACKCHEF_ENABLED}" ]; then
75 sed -e "s:%SERVICE_TENANT_NAME%:${SERVICE_TENANT_NAME}:g" \
76 -i ${HEAT_CONF_DIR}/api-paste.ini
77 sed -e "s:%SERVICE_USER%:${SRCNAME}:g" -i ${HEAT_CONF_DIR}/api-paste.ini
78 sed -e "s:%SERVICE_PASSWORD%:${SERVICE_PASSWORD}:g" -i ${HEAT_CONF_DIR}/api-paste.ini
79 sed -e "s:%CONTROLLER_IP%:${CONTROLLER_IP}:g" -i ${HEAT_CONF_DIR}/api-paste.ini
74 80
75 sed -e "s:%SERVICE_TENANT_NAME%:${SERVICE_TENANT_NAME}:g" \ 81 sed -e "s:%DB_USER%:${DB_USER}:g" -i ${HEAT_CONF_DIR}/heat.conf
76 -i ${HEAT_CONF_DIR}/api-paste.ini 82 sed -e "s:%DB_PASSWORD%:${DB_PASSWORD}:g" -i ${HEAT_CONF_DIR}/heat.conf
77 sed -e "s:%SERVICE_USER%:${SRCNAME}:g" -i ${HEAT_CONF_DIR}/api-paste.ini
78 sed -e "s:%SERVICE_PASSWORD%:${SERVICE_PASSWORD}:g" -i ${HEAT_CONF_DIR}/api-paste.ini
79 sed -e "s:%CONTROLLER_IP%:${CONTROLLER_IP}:g" -i ${HEAT_CONF_DIR}/api-paste.ini
80 83
81 sed -e "s:%DB_USER%:${DB_USER}:g" -i ${HEAT_CONF_DIR}/heat.conf 84 sed -e "s:%CONTROLLER_IP%:${CONTROLLER_IP}:g" -i ${HEAT_CONF_DIR}/heat.conf
82 sed -e "s:%DB_PASSWORD%:${DB_PASSWORD}:g" -i ${HEAT_CONF_DIR}/heat.conf 85 sed -e "s:%CONTROLLER_HOST%:${CONTROLLER_HOST}:g" -i ${HEAT_CONF_DIR}/heat.conf
83 86
84 sed -e "s:%CONTROLLER_IP%:${CONTROLLER_IP}:g" -i ${HEAT_CONF_DIR}/heat.conf 87 sed -e "s:%COMPUTE_IP%:${COMPUTE_IP}:g" -i ${HEAT_CONF_DIR}/heat.conf
85 sed -e "s:%CONTROLLER_HOST%:${CONTROLLER_HOST}:g" -i ${HEAT_CONF_DIR}/heat.conf 88 sed -e "s:%COMPUTE_HOST%:${COMPUTE_HOST}:g" -i ${HEAT_CONF_DIR}/heat.conf
86
87 sed -e "s:%COMPUTE_IP%:${COMPUTE_IP}:g" -i ${HEAT_CONF_DIR}/heat.conf
88 sed -e "s:%COMPUTE_HOST%:${COMPUTE_HOST}:g" -i ${HEAT_CONF_DIR}/heat.conf
89
90 sed -e "s:%ADMIN_PASSWORD%:${ADMIN_PASSWORD}:g" -i ${HEAT_CONF_DIR}/heat.conf
91 sed -e "s:%SERVICE_TENANT_NAME%:${SERVICE_TENANT_NAME}:g" -i ${HEAT_CONF_DIR}/heat.conf
92 89
90 sed -e "s:%ADMIN_PASSWORD%:${ADMIN_PASSWORD}:g" -i ${HEAT_CONF_DIR}/heat.conf
91 sed -e "s:%SERVICE_TENANT_NAME%:${SERVICE_TENANT_NAME}:g" -i ${HEAT_CONF_DIR}/heat.conf
92 fi
93 if ${@base_contains('DISTRO_FEATURES', 'sysvinit', 'true', 'false', d)}; then 93 if ${@base_contains('DISTRO_FEATURES', 'sysvinit', 'true', 'false', d)}; then
94 install -d ${D}${sysconfdir}/init.d 94 install -d ${D}${sysconfdir}/init.d
95 95
@@ -106,6 +106,10 @@ do_install_append() {
106 cp run_tests.sh ${HEAT_CONF_DIR} 106 cp run_tests.sh ${HEAT_CONF_DIR}
107} 107}
108 108
109CHEF_SERVICES_CONF_FILES :="\
110 ${sysconfdir}/${SRCNAME}/heat.conf \
111 ${sysconfdir}/${SRCNAME}/api-paste.ini \
112 "
109pkg_postinst_${SRCNAME}-setup () { 113pkg_postinst_${SRCNAME}-setup () {
110 if [ "x$D" != "x" ]; then 114 if [ "x$D" != "x" ]; then
111 exit 1 115 exit 1
@@ -123,7 +127,7 @@ pkg_postinst_${SRCNAME}-setup () {
123 heat-manage db_sync 127 heat-manage db_sync
124} 128}
125 129
126inherit setuptools identity hosts update-rc.d default_configs 130inherit setuptools identity hosts update-rc.d default_configs openstackchef
127 131
128PACKAGES += "${SRCNAME}-tests ${SRCNAME}-templates ${SRCNAME}-common ${SRCNAME}-api ${SRCNAME}-api-cfn ${SRCNAME}-engine" 132PACKAGES += "${SRCNAME}-tests ${SRCNAME}-templates ${SRCNAME}-common ${SRCNAME}-api ${SRCNAME}-api-cfn ${SRCNAME}-engine"
129PACKAGES += "${SRCNAME}-setup" 133PACKAGES += "${SRCNAME}-setup"