summaryrefslogtreecommitdiffstats
path: root/meta-openstack/recipes-devtools/python/python-nova_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-nova_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-nova_git.bb')
-rw-r--r--meta-openstack/recipes-devtools/python/python-nova_git.bb56
1 files changed, 31 insertions, 25 deletions
diff --git a/meta-openstack/recipes-devtools/python/python-nova_git.bb b/meta-openstack/recipes-devtools/python/python-nova_git.bb
index 207b965..5a8ba84 100644
--- a/meta-openstack/recipes-devtools/python/python-nova_git.bb
+++ b/meta-openstack/recipes-devtools/python/python-nova_git.bb
@@ -30,7 +30,7 @@ PV="2014.2.b3+git${SRCPV}"
30 30
31S = "${WORKDIR}/git" 31S = "${WORKDIR}/git"
32 32
33inherit update-rc.d setuptools identity hosts useradd default_configs 33inherit update-rc.d setuptools identity hosts useradd default_configs openstackchef
34 34
35LIBVIRT_IMAGES_TYPE ?= "default" 35LIBVIRT_IMAGES_TYPE ?= "default"
36 36
@@ -103,38 +103,38 @@ do_install_append() {
103 install -o nova -m 664 ${WORKDIR}/nova.conf ${NOVA_CONF_DIR}/nova.conf 103 install -o nova -m 664 ${WORKDIR}/nova.conf ${NOVA_CONF_DIR}/nova.conf
104 install -o nova -m 664 ${TEMPLATE_CONF_DIR}/api-paste.ini ${NOVA_CONF_DIR} 104 install -o nova -m 664 ${TEMPLATE_CONF_DIR}/api-paste.ini ${NOVA_CONF_DIR}
105 install -o nova -m 664 ${WORKDIR}/openrc ${NOVA_CONF_DIR} 105 install -o nova -m 664 ${WORKDIR}/openrc ${NOVA_CONF_DIR}
106 if [ -z "${OPENSTACKCHEF_ENABLED}" ]; then
107 # Configuration options
108 sed -e "s:%SERVICE_TENANT_NAME%:${SERVICE_TENANT_NAME}:g" \
109 -i ${NOVA_CONF_DIR}/api-paste.ini
110 sed -e "s:%SERVICE_USER%:${SRCNAME}:g" -i ${NOVA_CONF_DIR}/api-paste.ini
111 sed -e "s:%SERVICE_PASSWORD%:${SERVICE_PASSWORD}:g" \
112 -i ${NOVA_CONF_DIR}/api-paste.ini
113 sed -e "s:%CONTROLLER_IP%:${CONTROLLER_IP}:g" -i ${NOVA_CONF_DIR}/api-paste.ini
106 114
107 # Configuration options 115 sed -e "s:%DB_USER%:${DB_USER}:g" -i ${NOVA_CONF_DIR}/nova.conf
108 sed -e "s:%SERVICE_TENANT_NAME%:${SERVICE_TENANT_NAME}:g" \ 116 sed -e "s:%DB_PASSWORD%:${DB_PASSWORD}:g" -i ${NOVA_CONF_DIR}/nova.conf
109 -i ${NOVA_CONF_DIR}/api-paste.ini
110 sed -e "s:%SERVICE_USER%:${SRCNAME}:g" -i ${NOVA_CONF_DIR}/api-paste.ini
111 sed -e "s:%SERVICE_PASSWORD%:${SERVICE_PASSWORD}:g" \
112 -i ${NOVA_CONF_DIR}/api-paste.ini
113 sed -e "s:%CONTROLLER_IP%:${CONTROLLER_IP}:g" -i ${NOVA_CONF_DIR}/api-paste.ini
114 117
115 sed -e "s:%DB_USER%:${DB_USER}:g" -i ${NOVA_CONF_DIR}/nova.conf 118 sed -e "s:%METADATA_SHARED_SECRET%:${METADATA_SHARED_SECRET}:g" -i ${NOVA_CONF_DIR}/nova.conf
116 sed -e "s:%DB_PASSWORD%:${DB_PASSWORD}:g" -i ${NOVA_CONF_DIR}/nova.conf
117 119
118 sed -e "s:%METADATA_SHARED_SECRET%:${METADATA_SHARED_SECRET}:g" -i ${NOVA_CONF_DIR}/nova.conf 120 sed -e "s:%CONTROLLER_IP%:${CONTROLLER_IP}:g" -i ${NOVA_CONF_DIR}/nova.conf
121 sed -e "s:%CONTROLLER_HOST%:${CONTROLLER_HOST}:g" -i ${NOVA_CONF_DIR}/nova.conf
119 122
120 sed -e "s:%CONTROLLER_IP%:${CONTROLLER_IP}:g" -i ${NOVA_CONF_DIR}/nova.conf 123 sed -e "s:%COMPUTE_IP%:${COMPUTE_IP}:g" -i ${NOVA_CONF_DIR}/nova.conf
121 sed -e "s:%CONTROLLER_HOST%:${CONTROLLER_HOST}:g" -i ${NOVA_CONF_DIR}/nova.conf 124 sed -e "s:%COMPUTE_HOST%:${COMPUTE_HOST}:g" -i ${NOVA_CONF_DIR}/nova.conf
122 125
123 sed -e "s:%COMPUTE_IP%:${COMPUTE_IP}:g" -i ${NOVA_CONF_DIR}/nova.conf 126 sed -e "s:%SERVICE_TENANT_NAME%:${SERVICE_TENANT_NAME}:g" -i ${NOVA_CONF_DIR}/nova.conf
124 sed -e "s:%COMPUTE_HOST%:${COMPUTE_HOST}:g" -i ${NOVA_CONF_DIR}/nova.conf 127 sed -e "s:%SERVICE_USER%:${SRCNAME}:g" -i ${NOVA_CONF_DIR}/nova.conf
128 sed -e "s:%SERVICE_PASSWORD%:${SERVICE_PASSWORD}:g" -i ${NOVA_CONF_DIR}/nova.conf
125 129
126 sed -e "s:%SERVICE_TENANT_NAME%:${SERVICE_TENANT_NAME}:g" -i ${NOVA_CONF_DIR}/nova.conf 130 sed -e "s:%LIBVIRT_IMAGES_TYPE%:${LIBVIRT_IMAGES_TYPE}:g" -i ${NOVA_CONF_DIR}/nova.conf
127 sed -e "s:%SERVICE_USER%:${SRCNAME}:g" -i ${NOVA_CONF_DIR}/nova.conf
128 sed -e "s:%SERVICE_PASSWORD%:${SERVICE_PASSWORD}:g" -i ${NOVA_CONF_DIR}/nova.conf
129 131
130 sed -e "s:%LIBVIRT_IMAGES_TYPE%:${LIBVIRT_IMAGES_TYPE}:g" -i ${NOVA_CONF_DIR}/nova.conf 132 sed -e "s:%OS_PASSWORD%:${ADMIN_PASSWORD}:g" -i ${NOVA_CONF_DIR}/openrc
131 133 sed -e "s:%SERVICE_TOKEN%:${SERVICE_TOKEN}:g" -i ${NOVA_CONF_DIR}/openrc
132 sed -e "s:%OS_PASSWORD%:${ADMIN_PASSWORD}:g" -i ${NOVA_CONF_DIR}/openrc
133 sed -e "s:%SERVICE_TOKEN%:${SERVICE_TOKEN}:g" -i ${NOVA_CONF_DIR}/openrc
134
135 sed -e "s:%CONTROLLER_IP%:${CONTROLLER_IP}:g" -i ${NOVA_CONF_DIR}/openrc
136 sed -e "s:%CONTROLLER_HOST%:${CONTROLLER_HOST}:g" -i ${NOVA_CONF_DIR}/openrc
137 134
135 sed -e "s:%CONTROLLER_IP%:${CONTROLLER_IP}:g" -i ${NOVA_CONF_DIR}/openrc
136 sed -e "s:%CONTROLLER_HOST%:${CONTROLLER_HOST}:g" -i ${NOVA_CONF_DIR}/openrc
137 fi
138 install -o nova -d ${NOVA_CONF_DIR}/instances 138 install -o nova -d ${NOVA_CONF_DIR}/instances
139 139
140 if ${@base_contains('DISTRO_FEATURES', 'sysvinit', 'true', 'false', d)}; then 140 if ${@base_contains('DISTRO_FEATURES', 'sysvinit', 'true', 'false', d)}; then
@@ -159,6 +159,12 @@ do_install_append() {
159 cp -r "${S}/plugins" "${D}/${PYTHON_SITEPACKAGES_DIR}/nova" 159 cp -r "${S}/plugins" "${D}/${PYTHON_SITEPACKAGES_DIR}/nova"
160} 160}
161 161
162CHEF_SERVICES_CONF_FILES := "\
163 ${sysconfdir}/${SRCNAME}/nova.conf \
164 ${sysconfdir}/${SRCNAME}/api-paste.ini \
165 ${sysconfdir}/${SRCNAME}/openrc \
166 "
167
162pkg_postinst_${SRCNAME}-setup () { 168pkg_postinst_${SRCNAME}-setup () {
163 if [ "x$D" != "x" ]; then 169 if [ "x$D" != "x" ]; then
164 exit 1 170 exit 1