summaryrefslogtreecommitdiffstats
path: root/meta-openstack/recipes-devtools/python/python-keystone_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-keystone_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-keystone_git.bb')
-rw-r--r--meta-openstack/recipes-devtools/python/python-keystone_git.bb57
1 files changed, 33 insertions, 24 deletions
diff --git a/meta-openstack/recipes-devtools/python/python-keystone_git.bb b/meta-openstack/recipes-devtools/python/python-keystone_git.bb
index 49aa278..5e7fca1 100644
--- a/meta-openstack/recipes-devtools/python/python-keystone_git.bb
+++ b/meta-openstack/recipes-devtools/python/python-keystone_git.bb
@@ -22,7 +22,7 @@ PV="2014.2.b3+git${SRCPV}"
22 22
23S = "${WORKDIR}/git" 23S = "${WORKDIR}/git"
24 24
25inherit setuptools update-rc.d identity hosts default_configs 25inherit setuptools update-rc.d identity hosts default_configs openstackchef
26 26
27SERVICE_TOKEN = "password" 27SERVICE_TOKEN = "password"
28TOKEN_FORMAT ?= "PKI" 28TOKEN_FORMAT ?= "PKI"
@@ -97,27 +97,36 @@ do_install_append() {
97 ${KEYSTONE_CGI_DIR}/main 97 ${KEYSTONE_CGI_DIR}/main
98 98
99 cp -r ${S}/examples ${KEYSTONE_PACKAGE_DIR} 99 cp -r ${S}/examples ${KEYSTONE_PACKAGE_DIR}
100 100
101 sed -e "s:%SERVICE_TOKEN%:${SERVICE_TOKEN}:g" \ 101 if [ -z "${OPENSTACKCHEF_ENABLED}" ]; then
102 -i ${KEYSTONE_CONF_DIR}/keystone.conf 102 sed -e "s:%SERVICE_TOKEN%:${SERVICE_TOKEN}:g" \
103 sed -e "s:%DB_USER%:${DB_USER}:g" -i ${KEYSTONE_CONF_DIR}/keystone.conf 103 -i ${KEYSTONE_CONF_DIR}/keystone.conf
104 sed -e "s:%DB_PASSWORD%:${DB_PASSWORD}:g" \ 104 sed -e "s:%DB_USER%:${DB_USER}:g" -i ${KEYSTONE_CONF_DIR}/keystone.conf
105 -i ${KEYSTONE_CONF_DIR}/keystone.conf 105 sed -e "s:%DB_PASSWORD%:${DB_PASSWORD}:g" \
106 106 -i ${KEYSTONE_CONF_DIR}/keystone.conf
107 sed -e "s:%CONTROLLER_IP%:${CONTROLLER_IP}:g" \ 107
108 -i ${KEYSTONE_CONF_DIR}/keystone.conf 108 sed -e "s:%CONTROLLER_IP%:${CONTROLLER_IP}:g" \
109 sed -e "s:%CONTROLLER_IP%:${CONTROLLER_IP}:g" \ 109 -i ${KEYSTONE_CONF_DIR}/keystone.conf
110 -i ${KEYSTONE_CONF_DIR}/identity.sh 110 sed -e "s:%CONTROLLER_IP%:${CONTROLLER_IP}:g" \
111 111 -i ${KEYSTONE_CONF_DIR}/identity.sh
112 sed -e "s:%TOKEN_FORMAT%:${TOKEN_FORMAT}:g" \ 112
113 -i ${KEYSTONE_CONF_DIR}/keystone.conf 113 sed -e "s:%TOKEN_FORMAT%:${TOKEN_FORMAT}:g" \
114 114 -i ${KEYSTONE_CONF_DIR}/keystone.conf
115
116 sed -e "s/%ADMIN_PASSWORD%/${ADMIN_PASSWORD}/g" \
117 -i ${D}${sysconfdir}/init.d/keystone
118 sed -e "s/%SERVICE_PASSWORD%/${SERVICE_PASSWORD}/g" \
119 -i ${D}${sysconfdir}/init.d/keystone
120 sed -e "s/%SERVICE_TENANT_NAME%/${SERVICE_TENANT_NAME}/g" \
121 -i ${D}${sysconfdir}/init.d/keystone
122 fi
123
115 sed "/# admin_endpoint = .*/a \ 124 sed "/# admin_endpoint = .*/a \
116 public_endpoint = http://${CONTROLLER_IP}:8081/keystone/main/ " \ 125 public_endpoint = http://%CONTROLLER_IP%:8081/keystone/main/ " \
117 -i ${KEYSTONE_CONF_DIR}/keystone.conf 126 -i ${KEYSTONE_CONF_DIR}/keystone.conf
118 127
119 sed "/# admin_endpoint = .*/a \ 128 sed "/# admin_endpoint = .*/a \
120 admin_endpoint = http://${CONTROLLER_IP}:8081/keystone/admin/ " \ 129 admin_endpoint = http://%CONTROLLER_IP%:8081/keystone/admin/ " \
121 -i ${KEYSTONE_CONF_DIR}/keystone.conf 130 -i ${KEYSTONE_CONF_DIR}/keystone.conf
122 131
123 if ${@base_contains('DISTRO_FEATURES', 'sysvinit', 'true', 'false', d)}; 132 if ${@base_contains('DISTRO_FEATURES', 'sysvinit', 'true', 'false', d)};
@@ -135,12 +144,6 @@ do_install_append() {
135 144
136 cp run_tests.sh ${KEYSTONE_CONF_DIR} 145 cp run_tests.sh ${KEYSTONE_CONF_DIR}
137 146
138 sed -e "s/%ADMIN_PASSWORD%/${ADMIN_PASSWORD}/g" \
139 -i ${D}${sysconfdir}/init.d/keystone
140 sed -e "s/%SERVICE_PASSWORD%/${SERVICE_PASSWORD}/g" \
141 -i ${D}${sysconfdir}/init.d/keystone
142 sed -e "s/%SERVICE_TENANT_NAME%/${SERVICE_TENANT_NAME}/g" \
143 -i ${D}${sysconfdir}/init.d/keystone
144 147
145 if ${@base_contains('DISTRO_FEATURES', 'OpenLDAP', 'true', 'false', d)}; 148 if ${@base_contains('DISTRO_FEATURES', 'OpenLDAP', 'true', 'false', d)};
146 then 149 then
@@ -187,6 +190,12 @@ role_tree_dn = ou=Roles,${LDAP_DN} \
187 fi 190 fi
188} 191}
189 192
193CHEF_SERVICES_CONF_FILES := "\
194 ${sysconfdir}/${SRCNAME}/keystone.conf \
195 ${sysconfdir}/${SRCNAME}/identity.sh \
196 ${sysconfdir}/init.d/keystone \
197 "
198
190pkg_postinst_${SRCNAME}-setup () { 199pkg_postinst_${SRCNAME}-setup () {
191 # python-keystone postinst start 200 # python-keystone postinst start
192 if [ "x$D" != "x" ]; then 201 if [ "x$D" != "x" ]; then