aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--meta-openstack/recipes-devtools/python/python-cinder_git.bb40
-rw-r--r--meta-openstack/recipes-devtools/python/python-glance_git.bb40
-rw-r--r--meta-openstack/recipes-devtools/python/python-neutron_git.bb67
3 files changed, 96 insertions, 51 deletions
diff --git a/meta-openstack/recipes-devtools/python/python-cinder_git.bb b/meta-openstack/recipes-devtools/python/python-cinder_git.bb
index 5abf4bc4..ef666564 100644
--- a/meta-openstack/recipes-devtools/python/python-cinder_git.bb
+++ b/meta-openstack/recipes-devtools/python/python-cinder_git.bb
@@ -24,7 +24,7 @@ SRCREV="58eda5d1f41082a7e1ffef66239be30b8ac1321a"
PV="2014.2.b3+git${SRCPV}"
S = "${WORKDIR}/git"
-inherit setuptools update-rc.d identity default_configs hosts
+inherit setuptools update-rc.d identity default_configs hosts openstackchef
CINDER_BACKUP_BACKEND_DRIVER ?= "cinder.backup.drivers.swift"
@@ -61,23 +61,12 @@ CINDER_GLUSTERFS_VOLUME_SERVERS ?= "${CINDER_GLUSTERFS_VOLUME_SERVERS_DEFAULT}"
do_install_append() {
TEMPLATE_CONF_DIR=${S}${sysconfdir}/${SRCNAME}
CINDER_CONF_DIR=${D}${sysconfdir}/${SRCNAME}
-
- sed -e "s:%SERVICE_TENANT_NAME%:${SERVICE_TENANT_NAME}:g" \
- ${TEMPLATE_CONF_DIR}/api-paste.ini > ${WORKDIR}/api-paste.ini
- sed -e "s:%SERVICE_USER%:${SRCNAME}:g" -i ${WORKDIR}/api-paste.ini
- sed -e "s:%SERVICE_PASSWORD%:${SERVICE_PASSWORD}:g" \
- -i ${WORKDIR}/api-paste.ini
-
- sed -e "s:%DB_USER%:${DB_USER}:g" -i ${WORKDIR}/cinder.conf
- sed -e "s:%DB_PASSWORD%:${DB_PASSWORD}:g" -i ${WORKDIR}/cinder.conf
- sed -e "s:%CINDER_BACKUP_BACKEND_DRIVER%:${CINDER_BACKUP_BACKEND_DRIVER}:g" -i ${WORKDIR}/cinder.conf
- sed -e "s:%SERVICE_TENANT_NAME%:${SERVICE_TENANT_NAME}:g" -i ${WORKDIR}/cinder.conf
- sed -e "s:%SERVICE_USER%:${SRCNAME}:g" -i ${WORKDIR}/cinder.conf
- sed -e "s:%SERVICE_PASSWORD%:${SERVICE_PASSWORD}:g" -i ${WORKDIR}/cinder.conf
-
+
+ #Instead of substituting api-paste.ini from the WORKDIR,
+ #move it over to the image's directory and do the substitution there
install -d ${CINDER_CONF_DIR}
install -m 600 ${WORKDIR}/cinder.conf ${CINDER_CONF_DIR}/
- install -m 600 ${WORKDIR}/api-paste.ini ${CINDER_CONF_DIR}/
+ install -m 600 ${TEMPLATE_CONF_DIR}/api-paste.ini ${CINDER_CONF_DIR}/
install -m 600 ${S}/etc/cinder/policy.json ${CINDER_CONF_DIR}/
install -d ${CINDER_CONF_DIR}/drivers
@@ -87,6 +76,21 @@ do_install_append() {
install -m 700 ${WORKDIR}/add-cinder-volume-types.sh ${CINDER_CONF_DIR}/
install -d ${D}${localstatedir}/log/${SRCNAME}
+
+ if [ -z "${OPENSTACKCHEF_ENABLED}" ]; then
+ for file in api-paste.ini cinder.conf; do
+ sed -e "s:%SERVICE_TENANT_NAME%:${SERVICE_TENANT_NAME}:g" \
+ -i ${CINDER_CONF_DIR}/$file
+ sed -e "s:%SERVICE_USER%:${SRCNAME}:g" -i ${CINDER_CONF_DIR}/$file
+ sed -e "s:%SERVICE_PASSWORD%:${SERVICE_PASSWORD}:g" \
+ -i ${CINDER_CONF_DIR}/$file
+
+ sed -e "s:%DB_USER%:${DB_USER}:g" -i ${CINDER_CONF_DIR}/$file
+ sed -e "s:%DB_PASSWORD%:${DB_PASSWORD}:g" -i ${CINDER_CONF_DIR}/$file
+ sed -e "s:%CINDER_BACKUP_BACKEND_DRIVER%:${CINDER_BACKUP_BACKEND_DRIVER}:g" \
+ -i ${CINDER_CONF_DIR}/$file
+ done
+ fi
if ${@base_contains('DISTRO_FEATURES', 'sysvinit', 'true', 'false', d)}; then
install -d ${D}${sysconfdir}/init.d
@@ -121,6 +125,10 @@ do_install_append() {
sed -e "s:%IS_DEFAULT%:${is_default}:g" -i ${D}/etc/cinder/drivers/glusterfs_setup.sh
}
+CHEF_SERVICES_CONF_FILES :="\
+ ${sysconfdir}/${SRCNAME}/cinder.conf \
+ ${sysconfdir}/${SRCNAME}/api-paste.ini \
+ "
pkg_postinst_${SRCNAME}-setup () {
if [ "x$D" != "x" ]; then
exit 1
diff --git a/meta-openstack/recipes-devtools/python/python-glance_git.bb b/meta-openstack/recipes-devtools/python/python-glance_git.bb
index 77759569..fa74aca4 100644
--- a/meta-openstack/recipes-devtools/python/python-glance_git.bb
+++ b/meta-openstack/recipes-devtools/python/python-glance_git.bb
@@ -19,7 +19,7 @@ PV="2014.2.b3+git${SRCPV}"
S = "${WORKDIR}/git"
-inherit setuptools update-rc.d identity default_configs hosts
+inherit setuptools update-rc.d identity default_configs hosts openstackchef
GLANCE_DEFAULT_STORE ?= "file"
GLANCE_KNOWN_STORES ?= "glance.store.rbd.Store,\
@@ -58,18 +58,15 @@ do_install_prepend() {
do_install_append() {
TEMPLATE_CONF_DIR=${S}${sysconfdir}
GLANCE_CONF_DIR=${D}${sysconfdir}/glance
-
+
for file in api registry cache
do
- sed -e "s:%SERVICE_TENANT_NAME%:${SERVICE_TENANT_NAME}:g" \
- ${TEMPLATE_CONF_DIR}/glance-$file.conf > ${WORKDIR}/glance-$file.conf
- sed -e "s:%SERVICE_USER%:${SRCNAME}:g" -i ${WORKDIR}/glance-$file.conf
- sed -e "s:%SERVICE_PASSWORD%:${SERVICE_PASSWORD}:g" \
- -i ${WORKDIR}/glance-$file.conf
- sed -e "s!^#connection =.*!connection = postgresql://${DB_USER}:${DB_PASSWORD}@localhost/glance!g" \
- -i ${WORKDIR}/glance-$file.conf
+ install -m 0600 ${TEMPLATE_CONF_DIR}/glance-$file.conf ${WORKDIR}
+ sed -e "s!^#connection =.*!connection = postgresql://%DB_USER%:%DB_PASSWORD%@localhost/glance!g" \
+ -i ${WORKDIR}/glance-$file.conf
sed -i '/\[keystone_authtoken\]/aidentity_uri=http://127.0.0.1:8081/keystone/admin' ${WORKDIR}/glance-$file.conf
done
+
sed -e "s:^filesystem_store_datadir =.*:filesystem_store_datadir = ${sysconfdir}/${SRCNAME}/images/:g" \
-i ${WORKDIR}/glance-api.conf
@@ -79,8 +76,8 @@ do_install_append() {
sed 's:^default_store =.*:default_store = ${GLANCE_DEFAULT_STORE}:g' -i ${WORKDIR}/glance-api.conf
sed 's:^swift_store_auth_address =.*:swift_store_auth_address = http\://127.0.0.1\:8081/keystone/main/:g' -i ${WORKDIR}/glance-api.conf
- sed 's:^swift_store_user =.*:swift_store_user = ${SERVICE_TENANT_NAME}\:${SRCNAME}:g' -i ${WORKDIR}/glance-api.conf
- sed 's:^swift_store_key =.*:swift_store_key = ${SERVICE_PASSWORD}:g' -i ${WORKDIR}/glance-api.conf
+ sed 's:^swift_store_user =.*:swift_store_user = %SERVICE_TENANT_NAME%\:${SRCNAME}:g' -i ${WORKDIR}/glance-api.conf
+ sed 's:^swift_store_key =.*:swift_store_key = %SERVICE_PASSWORD%:g' -i ${WORKDIR}/glance-api.conf
sed 's:^swift_store_create_container_on_put =.*:swift_store_create_container_on_put = True:g' -i ${WORKDIR}/glance-api.conf
# multi line match, replace the known stores with the ones we support.
@@ -101,6 +98,21 @@ do_install_append() {
install -d ${D}${localstatedir}/log/${SRCNAME}
+ if [ -z "${OPENSTACKCHEF_ENABLED}" ]; then
+ for file in api registry cache
+ do
+ sed -e "s:%SERVICE_TENANT_NAME%:${SERVICE_TENANT_NAME}:g" \
+ -i ${GLANCE_CONF_DIR}/glance-$file.conf
+ sed -e "s:%SERVICE_USER%:${SRCNAME}:g" -i ${GLANCE_CONF_DIR}/glance-$file.conf
+ sed -e "s:%SERVICE_PASSWORD%:${SERVICE_PASSWORD}:g" \
+ -i ${GLANCE_CONF_DIR}/glance-$file.conf
+ sed -e "s:%DB_PASSWORD%:${DB_PASSWORD}:g" \
+ -i ${GLANCE_CONF_DIR}/glance-$file.conf
+ sed -e "s:%DB_USER%:${DB_USER}:g" \
+ -i ${GLANCE_CONF_DIR}/glance-$file.conf
+ done
+ fi
+
if ${@base_contains('DISTRO_FEATURES', 'sysvinit', 'true', 'false', d)}; then
install -d ${D}${sysconfdir}/init.d
sed 's:@suffix@:api:' < ${WORKDIR}/glance.init >${WORKDIR}/glance-api.init.sh
@@ -112,6 +124,12 @@ do_install_append() {
cp run_tests.sh ${GLANCE_CONF_DIR}
}
+CHEF_SERVICES_CONF_FILES := "\
+ ${sysconfdir}/${SRCNAME}/glance-api.conf \
+ ${sysconfdir}/${SRCNAME}/glance-cache.conf \
+ ${sysconfdir}/${SRCNAME}/glance-registry.conf \
+ "
+
pkg_postinst_${SRCNAME}-setup () {
if [ "x$D" != "x" ]; then
exit 1
diff --git a/meta-openstack/recipes-devtools/python/python-neutron_git.bb b/meta-openstack/recipes-devtools/python/python-neutron_git.bb
index 295db972..f9614873 100644
--- a/meta-openstack/recipes-devtools/python/python-neutron_git.bb
+++ b/meta-openstack/recipes-devtools/python/python-neutron_git.bb
@@ -25,7 +25,7 @@ PV="2014.2.b3+git${SRCPV}"
S = "${WORKDIR}/git"
-inherit setuptools update-rc.d identity hosts default_configs
+inherit setuptools update-rc.d identity hosts default_configs openstackchef
SERVICECREATE_PACKAGES = "${SRCNAME}-setup"
KEYSTONE_HOST="${CONTROLLER_IP}"
@@ -60,11 +60,11 @@ do_install_append() {
install -m 600 ${S}/etc/api-paste.ini ${NEUTRON_CONF_DIR}/
install -m 600 ${S}/etc/policy.json ${NEUTRON_CONF_DIR}/
- sed -e "s:%SERVICE_TENANT_NAME%:${SERVICE_TENANT_NAME}:g" \
- -i ${NEUTRON_CONF_DIR}/neutron.conf
- sed -e "s:%SERVICE_USER%:${SRCNAME}:g" -i ${NEUTRON_CONF_DIR}/neutron.conf
- sed -e "s:%SERVICE_PASSWORD%:${SERVICE_PASSWORD}:g" \
- -i ${NEUTRON_CONF_DIR}/neutron.conf
+ #sed -e "s:%SERVICE_TENANT_NAME%:${SERVICE_TENANT_NAME}:g" \
+ # -i ${NEUTRON_CONF_DIR}/neutron.conf
+ #sed -e "s:%SERVICE_USER%:${SRCNAME}:g" -i ${NEUTRON_CONF_DIR}/neutron.conf
+ #sed -e "s:%SERVICE_PASSWORD%:${SERVICE_PASSWORD}:g" \
+ # -i ${NEUTRON_CONF_DIR}/neutron.conf
sed -e "s:^# core_plugin.*:core_plugin = neutron.plugins.openvswitch.ovs_neutron_plugin.OVSNeutronPluginV2:g" \
-i ${NEUTRON_CONF_DIR}/neutron.conf
@@ -74,15 +74,7 @@ do_install_append() {
sed -e "s:^# notify_nova_on_port_data_changes.*:notify_nova_on_port_data_changes = False:g" \
-i ${NEUTRON_CONF_DIR}/neutron.conf
- sed -e "s:^# rabbit_host =.*:rabbit_host = ${CONTROLLER_IP}:" -i ${NEUTRON_CONF_DIR}/neutron.conf
-
- for file in plugins/openvswitch/ovs_neutron_plugin.ini plugins/linuxbridge/linuxbridge_conf.ini
- do
- sed -e "s:%DB_USER%:${DB_USER}:g" -i ${NEUTRON_CONF_DIR}/${file}
- sed -e "s:%DB_PASSWORD%:${DB_PASSWORD}:g" -i ${NEUTRON_CONF_DIR}/${file}
- sed -e "s:%CONTROLLER_IP%:${CONTROLLER_IP}:g" -i ${NEUTRON_CONF_DIR}/${file}
- sed -e "s:%CONTROLLER_HOST%:${CONTROLLER_HOST}:g" -i ${NEUTRON_CONF_DIR}/${file}
- done
+ sed -e "s:^# rabbit_host =.*:rabbit_host = %CONTROLLER_IP%:" -i ${NEUTRON_CONF_DIR}/neutron.conf
PLUGIN=openvswitch
ARGS="--config-file=${sysconfdir}/${SRCNAME}/neutron.conf --config-file=${sysconfdir}/${SRCNAME}/plugins/openvswitch/ovs_neutron_plugin.ini"
@@ -121,15 +113,23 @@ do_install_append() {
install -m 0755 ${WORKDIR}/neutron-$AGENT.init.sh ${D}${sysconfdir}/init.d/neutron-$AGENT-agent
install -m 600 ${WORKDIR}/${AGENT}_agent.ini ${NEUTRON_CONF_DIR}/
fi
- sed -e "s:%SERVICE_TENANT_NAME%:${SERVICE_TENANT_NAME}:g" \
- -i ${NEUTRON_CONF_DIR}/metadata_agent.ini
- sed -e "s:%SERVICE_USER%:${SRCNAME}:g" \
- -i ${NEUTRON_CONF_DIR}/metadata_agent.ini
- sed -e "s:%SERVICE_PASSWORD%:${SERVICE_PASSWORD}:g" \
- -i ${NEUTRON_CONF_DIR}/metadata_agent.ini
- sed -e "s:%METADATA_SHARED_SECRET%:${METADATA_SHARED_SECRET}:g" \
- -i ${NEUTRON_CONF_DIR}/metadata_agent.ini
-
+ if [ -z "${OPENSTACKCHEF_ENABLED}" ]; then
+ for file in plugins/openvswitch/ovs_neutron_plugin.ini \
+ plugins/linuxbridge/linuxbridge_conf.ini neutron.conf metadata_agent.ini; do
+ sed -e "s:%SERVICE_TENANT_NAME%:${SERVICE_TENANT_NAME}:g" \
+ -i ${NEUTRON_CONF_DIR}/$file
+ sed -e "s:%SERVICE_USER%:${SRCNAME}:g" \
+ -i ${NEUTRON_CONF_DIR}/$file
+ sed -e "s:%SERVICE_PASSWORD%:${SERVICE_PASSWORD}:g" \
+ -i ${NEUTRON_CONF_DIR}/$file
+ sed -e "s:%METADATA_SHARED_SECRET%:${METADATA_SHARED_SECRET}:g" \
+ -i ${NEUTRON_CONF_DIR}/$file
+ sed -e "s:%DB_USER%:${DB_USER}:g" -i ${NEUTRON_CONF_DIR}/$file
+ sed -e "s:%DB_PASSWORD%:${DB_PASSWORD}:g" -i ${NEUTRON_CONF_DIR}/$file
+ sed -e "s:%CONTROLLER_IP%:${CONTROLLER_IP}:g" -i ${NEUTRON_CONF_DIR}/$file
+ sed -e "s:%CONTROLLER_HOST%:${CONTROLLER_HOST}:g" -i ${NEUTRON_CONF_DIR}/$file
+ done
+ fi
sed -e "s:^auth_host.*:#auth_host:g" -i ${NEUTRON_CONF_DIR}/neutron.conf
sed -e "s:^auth_port.*:#auth_port:g" -i ${NEUTRON_CONF_DIR}/neutron.conf
sed -e "s:^auth_protocol.*:#auth_protocol:g" -i ${NEUTRON_CONF_DIR}/neutron.conf
@@ -157,6 +157,25 @@ pkg_postinst_${SRCNAME}-setup () {
--config-file /etc/neutron/plugins/openvswitch/ovs_neutron_plugin.ini upgrade head
}
+CHEF_SERVICES_CONF_FILES := " \
+ ${sysconfdir}/${SRCNAME}/neutron.conf \
+ ${sysconfdir}/${SRCNAME}/metadata_agent.ini \
+ ${sysconfdir}/${SRCNAME}/plugins/openvswitch/ovs_neutron_plugin.ini \
+ ${sysconfdir}/${SRCNAME}/plugins/linuxbridge/linuxbridge_conf.ini \
+ "
+deploychef_services_special_func(){
+ #This function is a callback function for the deploychef .bbclass
+ #We define this special callback funtion because we are doing
+ #more than a placeholder substitution. The variable CHEF_SERVICES_FILE_NAME
+ #is defined in deploychef_framework.bbclass
+ if [ -n "${CHEF_SERVICES_FILE_NAME}" ]; then
+ sed "s:^# rabbit_host =.*:rabbit_host = %CONTROLLER_IP%:" -i \
+ ${CHEF_SERVICES_FILE_NAME}
+ fi
+}
+
+CHEF_SERVICES_SPECIAL_FUNC := "deploychef_services_special_func"
+
pkg_postinst_${SRCNAME}-plugin-openvswitch-setup () {
if [ "x$D" != "x" ]; then
exit 1