From 6e8b7c9fb262768cb89712948b9fadf461e472ba Mon Sep 17 00:00:00 2001 From: Bruce Ashfield Date: Sun, 25 Aug 2013 23:59:46 -0400 Subject: nova: split into explicit compute and controller recipes To allow unique configuration of nova for compute and controller nodes, the nova class is split into two, but packaged largely the same way. The compute and controller classes are introduced to hold configuration values and operations that are used by the common packaging routines to customize and deploy. Signed-off-by: Bruce Ashfield --- .../python/python-nova-controller_2013.1.3.bb | 52 ++++++++++++++++++++++ 1 file changed, 52 insertions(+) create mode 100644 meta-openstack/recipes-devtools/python/python-nova-controller_2013.1.3.bb (limited to 'meta-openstack/recipes-devtools/python/python-nova-controller_2013.1.3.bb') diff --git a/meta-openstack/recipes-devtools/python/python-nova-controller_2013.1.3.bb b/meta-openstack/recipes-devtools/python/python-nova-controller_2013.1.3.bb new file mode 100644 index 0000000..686c1d7 --- /dev/null +++ b/meta-openstack/recipes-devtools/python/python-nova-controller_2013.1.3.bb @@ -0,0 +1,52 @@ +include python-nova.inc + +PR = "r0" + +FILESEXTRAPATHS := "${THISDIR}/${PYTHON_PN}" + +SRC_URI += "file://nova-all \ + file://nova.conf \ + file://openrc \ + " + +inherit controller update-rc.d + +PACKAGES = "${SRCNAME}-controller ${SRCNAME}-controller-misc" + +do_install_append() { + if ${@base_contains('DISTRO_FEATURES', 'sysvinit', 'true', 'false', d)}; then + install -d ${D}${sysconfdir}/init.d + install -m 0755 ${WORKDIR}/nova-all ${D}${sysconfdir}/init.d/nova-all + fi +} + +pkg_postinst_${SRCNAME}-controller () { + if [ "x$D" != "x" ]; then + exit 1 + fi + + # This is to make sure postgres is configured and running + if ! pidof postmaster > /dev/null; then + sudo -u postgres initdb -D /etc/postgresql/ + /etc/init.d/postgresql start + sleep 0.2 + sudo -u postgres psql -c "CREATE ROLE ${DB_USER} WITH SUPERUSER LOGIN PASSWORD '${DB_PASSWORD}'" + fi + + sudo -u postgres createdb nova + nova-manage db sync +} + + +FILES_${SRCNAME}-controller = "${files_${SRCNAME}-controller}" + +# If the compute is built, so we package it out of the way +FILES_${SRCNAME}-controller-misc = "${files_${SRCNAME}-compute} ${files_${SRCNAME}-common} ${files_${PYTHON_PN}}" + +RDEPENDS_${SRCNAME}-controller = "${PYTHON_PN} ${SRCNAME}-common \ + postgresql postgresql-client python-psycopg2" + +RCONFLICTS_${SRCNAME}-controller = "${SRCNAME}-compute" + +INITSCRIPT_PACKAGES = "${SRCNAME}-controller" +INITSCRIPT_NAME_${SRCNAME}-controller = "nova-all" -- cgit v1.2.3-54-g00ecf