diff options
| author | Bruce Ashfield <bruce.ashfield@windriver.com> | 2013-10-04 00:26:04 -0400 |
|---|---|---|
| committer | Bruce Ashfield <bruce.ashfield@windriver.com> | 2013-10-04 00:26:04 -0400 |
| commit | 6806482a7ba6f020b0cff44b2b797eede2b702af (patch) | |
| tree | cfc7df9ca2c8e110ebe8a5b94c782c691b8f5878 /meta-openstack/recipes-devtools/python | |
| parent | ce230a25691dab2c8f3c7b9fc7ef37d548f8f90b (diff) | |
| download | meta-cloud-services-6806482a7ba6f020b0cff44b2b797eede2b702af.tar.gz | |
python-nova: unify controller and compute recipes
The split of compute and controller is no longer necesary, since configuration
inheritance is done with overriding layers, not split recipes.
This simplifies the build, and packaging of the recipe. Good riddance.
Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com>
Diffstat (limited to 'meta-openstack/recipes-devtools/python')
4 files changed, 158 insertions, 269 deletions
diff --git a/meta-openstack/recipes-devtools/python/python-nova-compute_2013.1.3.bb b/meta-openstack/recipes-devtools/python/python-nova-compute_2013.1.3.bb deleted file mode 100644 index 2511b28..0000000 --- a/meta-openstack/recipes-devtools/python/python-nova-compute_2013.1.3.bb +++ /dev/null | |||
| @@ -1,51 +0,0 @@ | |||
| 1 | |||
| 2 | include python-nova.inc | ||
| 3 | |||
| 4 | PR = "r0" | ||
| 5 | |||
| 6 | FILESEXTRAPATHS := "${THISDIR}/${PYTHON_PN}" | ||
| 7 | |||
| 8 | SRC_URI += "file://nova-compute \ | ||
| 9 | file://nova.conf \ | ||
| 10 | file://openrc \ | ||
| 11 | " | ||
| 12 | |||
| 13 | inherit hosts update-rc.d | ||
| 14 | |||
| 15 | PACKAGES = "${PN} ${SRCNAME}-compute ${SRCNAME}-compute-misc" | ||
| 16 | |||
| 17 | do_install_append() { | ||
| 18 | if ${@base_contains('DISTRO_FEATURES', 'sysvinit', 'true', 'false', d)}; then | ||
| 19 | install -d ${D}${sysconfdir}/init.d | ||
| 20 | install -m 0755 ${WORKDIR}/nova-compute ${D}${sysconfdir}/init.d/nova-compute | ||
| 21 | fi | ||
| 22 | } | ||
| 23 | |||
| 24 | #FILES_${SRCNAME}-compute = " ${files_${SRCNAME}-compute}" | ||
| 25 | # | ||
| 26 | # the controller is built, so we package it out of the way | ||
| 27 | |||
| 28 | #FILES_${SRCNAME}-compute-misc = "${files_${SRCNAME}-controller} | ||
| 29 | #${files_${SRCNAME}-common} ${files_${PYTHON_PN}}" | ||
| 30 | |||
| 31 | FILES_${PN} = "${libdir}/python*" | ||
| 32 | |||
| 33 | FILES_${SRCNAME}-compute = " \ | ||
| 34 | ${bindir}/nova-compute \ | ||
| 35 | ${sysconfdir}/${SRCNAME}/* \ | ||
| 36 | ${sysconfdir}/init.d/nova-compute" | ||
| 37 | |||
| 38 | FILES_${SRCNAME}-compute-misc = " \ | ||
| 39 | ${bindir} \ | ||
| 40 | ${sysconfdir}/init.d/nova-all \ | ||
| 41 | ${bindir}/nova-manage \ | ||
| 42 | ${bindir}/nova-rootwrap \ | ||
| 43 | ${sysconfdir}/sudoers.d" | ||
| 44 | |||
| 45 | RDEPENDS_${SRCNAME}-compute = "${PYTHON_PN} ${SRCNAME}-common \ | ||
| 46 | qemu libvirt libvirt-libvirtd libvirt-python libvirt-virsh" | ||
| 47 | |||
| 48 | RCONFLICTS_${SRCNAME}-compute = "${SRCNAME}-controller" | ||
| 49 | |||
| 50 | INITSCRIPT_PACKAGES = "${SRCNAME}-compute" | ||
| 51 | INITSCRIPT_NAME_${SRCNAME}-compute = "nova-compute" | ||
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 deleted file mode 100644 index c99a890..0000000 --- a/meta-openstack/recipes-devtools/python/python-nova-controller_2013.1.3.bb +++ /dev/null | |||
| @@ -1,87 +0,0 @@ | |||
| 1 | include python-nova.inc | ||
| 2 | |||
| 3 | PR = "r0" | ||
| 4 | |||
| 5 | FILESEXTRAPATHS := "${THISDIR}/${PYTHON_PN}" | ||
| 6 | |||
| 7 | SRC_URI += "file://nova-all \ | ||
| 8 | file://nova-consoleauth \ | ||
| 9 | file://nova-novncproxy \ | ||
| 10 | file://nova.conf \ | ||
| 11 | file://openrc \ | ||
| 12 | " | ||
| 13 | |||
| 14 | inherit hosts update-rc.d | ||
| 15 | |||
| 16 | PACKAGES = "${PN} ${PN}-dbg ${SRCNAME}-controller-misc ${SRCNAME}-controller" | ||
| 17 | PACKAGES += " ${SRCNAME}-consoleauth" | ||
| 18 | PACKAGES += " ${SRCNAME}-novncproxy" | ||
| 19 | |||
| 20 | do_install_append() { | ||
| 21 | if ${@base_contains('DISTRO_FEATURES', 'sysvinit', 'true', 'false', d)}; then | ||
| 22 | install -d ${D}${sysconfdir}/init.d | ||
| 23 | install -m 0755 ${WORKDIR}/nova-all ${D}${sysconfdir}/init.d/nova-all | ||
| 24 | install -m 0755 ${WORKDIR}/nova-consoleauth ${D}${sysconfdir}/init.d/nova-consoleauth | ||
| 25 | install -m 0755 ${WORKDIR}/nova-novncproxy ${D}${sysconfdir}/init.d/nova-novncproxy | ||
| 26 | fi | ||
| 27 | } | ||
| 28 | |||
| 29 | pkg_postinst_${SRCNAME}-controller () { | ||
| 30 | if [ "x$D" != "x" ]; then | ||
| 31 | exit 1 | ||
| 32 | fi | ||
| 33 | |||
| 34 | # This is to make sure postgres is configured and running | ||
| 35 | if ! pidof postmaster > /dev/null; then | ||
| 36 | sudo -u postgres initdb -D /etc/postgresql/ | ||
| 37 | /etc/init.d/postgresql start | ||
| 38 | sleep 0.2 | ||
| 39 | sudo -u postgres psql -c "CREATE ROLE ${DB_USER} WITH SUPERUSER LOGIN PASSWORD '${DB_PASSWORD}'" | ||
| 40 | fi | ||
| 41 | |||
| 42 | sudo -u postgres createdb nova | ||
| 43 | nova-manage db sync | ||
| 44 | } | ||
| 45 | |||
| 46 | |||
| 47 | #FILES_${SRCNAME}-controller = "${files_${SRCNAME}-controller}" | ||
| 48 | # | ||
| 49 | # If the compute is built, so we package it out of the way | ||
| 50 | |||
| 51 | #FILES_${SRCNAME}-controller-misc = "${files_${SRCNAME}-compute} | ||
| 52 | #${files_${SRCNAME}-common} ${files_${PYTHON_PN}}" | ||
| 53 | |||
| 54 | FILES_${SRCNAME}-controller = " \ | ||
| 55 | ${bindir} \ | ||
| 56 | ${sysconfdir}/${SRCNAME}/* \ | ||
| 57 | ${sysconfdir}/init.d/nova-all \ | ||
| 58 | " | ||
| 59 | |||
| 60 | FILES_${SRCNAME}-consoleauth = " \ | ||
| 61 | ${sysconfdir}/init.d/nova-consoleauth \ | ||
| 62 | " | ||
| 63 | FILES_${SRCNAME}-novncproxy = " \ | ||
| 64 | ${sysconfdir}/init.d/nova-novncproxy \ | ||
| 65 | " | ||
| 66 | |||
| 67 | FILES_${SRCNAME}-controller-misc = " \ | ||
| 68 | ${bindir}/nova-compute \ | ||
| 69 | ${sysconfdir}/init.d/nova-compute \ | ||
| 70 | ${bindir}/nova-manage \ | ||
| 71 | ${bindir}/nova-rootwrap \ | ||
| 72 | ${sysconfdir}/sudoers.d \ | ||
| 73 | ${libdir}" | ||
| 74 | |||
| 75 | FILES_${PN} = " \ | ||
| 76 | ${libdir}/python*/site-packages" | ||
| 77 | |||
| 78 | RDEPENDS_${SRCNAME}-controller = "${PYTHON_PN} ${SRCNAME}-common ${SRCNAME}-consoleauth \ | ||
| 79 | ${SRCNAME}-novncproxy \ | ||
| 80 | postgresql postgresql-client python-psycopg2" | ||
| 81 | |||
| 82 | RCONFLICTS_${SRCNAME}-controller = "${SRCNAME}-compute" | ||
| 83 | |||
| 84 | INITSCRIPT_PACKAGES = "${SRCNAME}-controller ${SRCNAME}-consoleauth ${SRCNAME}-novncproxy" | ||
| 85 | INITSCRIPT_NAME_${SRCNAME}-controller = "nova-all" | ||
| 86 | INITSCRIPT_NAME_${SRCNAME}-consoleauth = "nova-consoleauth" | ||
| 87 | INITSCRIPT_NAME_${SRCNAME}-novncproxy = "nova-novncproxy" | ||
diff --git a/meta-openstack/recipes-devtools/python/python-nova.inc b/meta-openstack/recipes-devtools/python/python-nova.inc deleted file mode 100644 index e520130..0000000 --- a/meta-openstack/recipes-devtools/python/python-nova.inc +++ /dev/null | |||
| @@ -1,102 +0,0 @@ | |||
| 1 | DESCRIPTION = "Nova is a cloud computing fabric controller" | ||
| 2 | HOMEPAGE = "https://launchpad.net/nova" | ||
| 3 | SECTION = "devel/python" | ||
| 4 | LICENSE = "Apache-2.0" | ||
| 5 | LIC_FILES_CHKSUM = "file://LICENSE;md5=1dece7821bf3fd70fe1309eaa37d52a2" | ||
| 6 | |||
| 7 | DEPENDS = "sudo" | ||
| 8 | |||
| 9 | SRCNAME = "nova" | ||
| 10 | PYTHON_PN = "python-nova" | ||
| 11 | |||
| 12 | FILESEXTRAPATHS := "${THISDIR}/${PYTHON_PN}" | ||
| 13 | |||
| 14 | SRC_URI = "https://launchpad.net/${SRCNAME}/grizzly/${PV}/+download/${SRCNAME}-${PV}.tar.gz \ | ||
| 15 | file://0001-nova-api-paste.ini-make-controller-IP-configurable.patch \ | ||
| 16 | " | ||
| 17 | |||
| 18 | SRC_URI[md5sum] = "6215982b9ed08b9042e088470d60a0a6" | ||
| 19 | SRC_URI[sha256sum] = "f7c25186920daccb16867c5fd272318beb8cc076e5a55f79b5906618ef2724f4" | ||
| 20 | |||
| 21 | S = "${WORKDIR}/${SRCNAME}-${PV}" | ||
| 22 | |||
| 23 | inherit setuptools identity | ||
| 24 | |||
| 25 | do_install_append() { | ||
| 26 | |||
| 27 | if [ ! -f "${WORKDIR}/nova.conf" ]; then | ||
| 28 | return | ||
| 29 | fi | ||
| 30 | |||
| 31 | TEMPLATE_CONF_DIR=${S}${sysconfdir}/${SRCNAME} | ||
| 32 | NOVA_CONF_DIR=${D}/${sysconfdir}/nova | ||
| 33 | |||
| 34 | install -d ${NOVA_CONF_DIR} | ||
| 35 | install -m 600 ${S}/etc/nova/policy.json ${NOVA_CONF_DIR}/ | ||
| 36 | |||
| 37 | # Deploy filters to /etc/nova/rootwrap.d | ||
| 38 | install -m 755 -d ${NOVA_CONF_DIR}/rootwrap.d | ||
| 39 | install -m 600 ${S}/etc/nova/rootwrap.d/*.filters ${NOVA_CONF_DIR}/rootwrap.d | ||
| 40 | chown -R root:root ${NOVA_CONF_DIR}/rootwrap.d | ||
| 41 | chmod 644 ${NOVA_CONF_DIR}/rootwrap.d | ||
| 42 | |||
| 43 | # Set up rootwrap.conf, pointing to /etc/nova/rootwrap.d | ||
| 44 | install -m 644 ${S}/etc/nova/rootwrap.conf ${NOVA_CONF_DIR}/ | ||
| 45 | sed -e "s:^filters_path=.*$:filters_path=${sysconfdir}/nova/rootwrap.d:" \ | ||
| 46 | -i ${NOVA_CONF_DIR}/rootwrap.conf | ||
| 47 | chown root:root $NOVA_CONF_DIR/rootwrap.conf | ||
| 48 | |||
| 49 | # Set up the rootwrap sudoers for nova | ||
| 50 | install -d ${D}${sysconfdir}/sudoers.d | ||
| 51 | touch ${D}${sysconfdir}/sudoers.d/nova-rootwrap | ||
| 52 | chmod 0440 ${D}${sysconfdir}/sudoers.d/nova-rootwrap | ||
| 53 | chown root:root ${D}${sysconfdir}/sudoers.d/nova-rootwrap | ||
| 54 | echo "root ALL=(root) NOPASSWD: ${bindir}/nova-rootwrap" > \ | ||
| 55 | ${D}${sysconfdir}/sudoers.d/nova-rootwrap | ||
| 56 | |||
| 57 | # Configuration options | ||
| 58 | sed -e "s:%SERVICE_TENANT_NAME%:${SERVICE_TENANT_NAME}:g" \ | ||
| 59 | ${TEMPLATE_CONF_DIR}/api-paste.ini > ${WORKDIR}/api-paste.ini | ||
| 60 | sed -e "s:%SERVICE_USER%:${SRCNAME}:g" -i ${WORKDIR}/api-paste.ini | ||
| 61 | sed -e "s:%SERVICE_PASSWORD%:${SERVICE_PASSWORD}:g" \ | ||
| 62 | -i ${WORKDIR}/api-paste.ini | ||
| 63 | sed -e "s:%CONTROLLER_IP%:${CONTROLLER_IP}:g" -i ${WORKDIR}/api-paste.ini | ||
| 64 | |||
| 65 | sed -e "s:%DB_USER%:${DB_USER}:g" -i ${WORKDIR}/nova.conf | ||
| 66 | sed -e "s:%DB_PASSWORD%:${DB_PASSWORD}:g" -i ${WORKDIR}/nova.conf | ||
| 67 | |||
| 68 | sed -e "s:%CONTROLLER_IP%:${CONTROLLER_IP}:g" -i ${WORKDIR}/nova.conf | ||
| 69 | sed -e "s:%CONTROLLER_HOST%:${CONTROLLER_HOST}:g" -i ${WORKDIR}/nova.conf | ||
| 70 | |||
| 71 | sed -e "s:%COMPUTE_IP%:${COMPUTE_IP}:g" -i ${WORKDIR}/nova.conf | ||
| 72 | sed -e "s:%COMPUTE_HOST%:${COMPUTE_HOST}:g" -i ${WORKDIR}/nova.conf | ||
| 73 | |||
| 74 | sed -e "s:%OS_PASSWORD%:${ADMIN_PASSWORD}:g" -i ${WORKDIR}/openrc | ||
| 75 | sed -e "s:%SERVICE_TOKEN%:${SERVICE_TOKEN}:g" -i ${WORKDIR}/openrc | ||
| 76 | |||
| 77 | sed -e "s:%CONTROLLER_IP%:${CONTROLLER_IP}:g" -i ${WORKDIR}/openrc | ||
| 78 | sed -e "s:%CONTROLLER_HOST%:${CONTROLLER_HOST}:g" -i ${WORKDIR}/openrc | ||
| 79 | |||
| 80 | # Copy the configuration file | ||
| 81 | install -m 664 ${WORKDIR}/nova.conf ${NOVA_CONF_DIR}/nova.conf | ||
| 82 | install -m 664 ${WORKDIR}/api-paste.ini ${NOVA_CONF_DIR} | ||
| 83 | install -m 664 ${WORKDIR}/openrc ${NOVA_CONF_DIR} | ||
| 84 | |||
| 85 | install -d ${NOVA_CONF_DIR}/instances | ||
| 86 | } | ||
| 87 | |||
| 88 | # note the lowercase "files", these variables are used in the packaging | ||
| 89 | # recipes themselves. | ||
| 90 | files_${PYTHON_PN} = "${libdir}/*" | ||
| 91 | |||
| 92 | files_${SRCNAME}-common = " ${bindir}/nova-manage \ | ||
| 93 | ${bindir}/nova-rootwrap \ | ||
| 94 | ${sysconfdir}/sudoers.d" | ||
| 95 | |||
| 96 | files_${SRCNAME}-compute = " ${bindir}/nova-compute \ | ||
| 97 | ${sysconfdir}/${SRCNAME}/* \ | ||
| 98 | ${sysconfdir}/init.d/nova-compute" | ||
| 99 | |||
| 100 | files_${SRCNAME}-controller = " ${bindir}/* \ | ||
| 101 | ${sysconfdir}/${SRCNAME}/* \ | ||
| 102 | ${sysconfdir}/init.d/nova-all" \ No newline at end of file | ||
diff --git a/meta-openstack/recipes-devtools/python/python-nova_2013.1.3.bb b/meta-openstack/recipes-devtools/python/python-nova_2013.1.3.bb index e7f844a..c2dd1f3 100644 --- a/meta-openstack/recipes-devtools/python/python-nova_2013.1.3.bb +++ b/meta-openstack/recipes-devtools/python/python-nova_2013.1.3.bb | |||
| @@ -1,49 +1,162 @@ | |||
| 1 | include python-nova.inc | 1 | DESCRIPTION = "Nova is a cloud computing fabric controller" |
| 2 | HOMEPAGE = "https://launchpad.net/nova" | ||
| 3 | SECTION = "devel/python" | ||
| 4 | LICENSE = "Apache-2.0" | ||
| 5 | LIC_FILES_CHKSUM = "file://LICENSE;md5=1dece7821bf3fd70fe1309eaa37d52a2" | ||
| 2 | 6 | ||
| 3 | inherit useradd | 7 | DEPENDS = "sudo" |
| 4 | 8 | ||
| 5 | pkg_postinst_${SRCNAME}-common () { | 9 | PR = "r0" |
| 6 | if [ "x$D" != "x" ]; then | 10 | SRCNAME = "nova" |
| 7 | exit 1 | 11 | |
| 12 | FILESEXTRAPATHS := "${THISDIR}/${PN}" | ||
| 13 | |||
| 14 | SRC_URI = "https://launchpad.net/${SRCNAME}/grizzly/${PV}/+download/${SRCNAME}-${PV}.tar.gz \ | ||
| 15 | file://0001-nova-api-paste.ini-make-controller-IP-configurable.patch \ | ||
| 16 | " | ||
| 17 | |||
| 18 | SRC_URI += "file://nova-all \ | ||
| 19 | file://nova-consoleauth \ | ||
| 20 | file://nova-novncproxy \ | ||
| 21 | file://nova.conf \ | ||
| 22 | file://openrc \ | ||
| 23 | " | ||
| 24 | |||
| 25 | SRC_URI[md5sum] = "6215982b9ed08b9042e088470d60a0a6" | ||
| 26 | SRC_URI[sha256sum] = "f7c25186920daccb16867c5fd272318beb8cc076e5a55f79b5906618ef2724f4" | ||
| 27 | |||
| 28 | S = "${WORKDIR}/${SRCNAME}-${PV}" | ||
| 29 | |||
| 30 | inherit update-rc.d setuptools identity hosts | ||
| 31 | |||
| 32 | do_install_append() { | ||
| 33 | if [ ! -f "${WORKDIR}/nova.conf" ]; then | ||
| 34 | return | ||
| 8 | fi | 35 | fi |
| 9 | 36 | ||
| 10 | if [ -d $D/home/root/ ]; then | 37 | TEMPLATE_CONF_DIR=${S}${sysconfdir}/${SRCNAME} |
| 11 | echo "source /etc/nova/openrc" >> $D/home/root/.bashrc | 38 | NOVA_CONF_DIR=${D}/${sysconfdir}/nova |
| 12 | elif [ -d $D/root/ ]; then | 39 | |
| 13 | echo "source /etc/nova/openrc" >> $D/root/.bashrc | 40 | install -d ${NOVA_CONF_DIR} |
| 41 | install -m 600 ${S}/etc/nova/policy.json ${NOVA_CONF_DIR}/ | ||
| 42 | |||
| 43 | # Deploy filters to /etc/nova/rootwrap.d | ||
| 44 | install -m 755 -d ${NOVA_CONF_DIR}/rootwrap.d | ||
| 45 | install -m 600 ${S}/etc/nova/rootwrap.d/*.filters ${NOVA_CONF_DIR}/rootwrap.d | ||
| 46 | chown -R root:root ${NOVA_CONF_DIR}/rootwrap.d | ||
| 47 | chmod 644 ${NOVA_CONF_DIR}/rootwrap.d | ||
| 48 | |||
| 49 | # Set up rootwrap.conf, pointing to /etc/nova/rootwrap.d | ||
| 50 | install -m 644 ${S}/etc/nova/rootwrap.conf ${NOVA_CONF_DIR}/ | ||
| 51 | sed -e "s:^filters_path=.*$:filters_path=${sysconfdir}/nova/rootwrap.d:" \ | ||
| 52 | -i ${NOVA_CONF_DIR}/rootwrap.conf | ||
| 53 | chown root:root $NOVA_CONF_DIR/rootwrap.conf | ||
| 54 | |||
| 55 | # Set up the rootwrap sudoers for nova | ||
| 56 | install -d ${D}${sysconfdir}/sudoers.d | ||
| 57 | touch ${D}${sysconfdir}/sudoers.d/nova-rootwrap | ||
| 58 | chmod 0440 ${D}${sysconfdir}/sudoers.d/nova-rootwrap | ||
| 59 | chown root:root ${D}${sysconfdir}/sudoers.d/nova-rootwrap | ||
| 60 | echo "root ALL=(root) NOPASSWD: ${bindir}/nova-rootwrap" > \ | ||
| 61 | ${D}${sysconfdir}/sudoers.d/nova-rootwrap | ||
| 62 | |||
| 63 | # Configuration options | ||
| 64 | sed -e "s:%SERVICE_TENANT_NAME%:${SERVICE_TENANT_NAME}:g" \ | ||
| 65 | ${TEMPLATE_CONF_DIR}/api-paste.ini > ${WORKDIR}/api-paste.ini | ||
| 66 | sed -e "s:%SERVICE_USER%:${SRCNAME}:g" -i ${WORKDIR}/api-paste.ini | ||
| 67 | sed -e "s:%SERVICE_PASSWORD%:${SERVICE_PASSWORD}:g" \ | ||
| 68 | -i ${WORKDIR}/api-paste.ini | ||
| 69 | sed -e "s:%CONTROLLER_IP%:${CONTROLLER_IP}:g" -i ${WORKDIR}/api-paste.ini | ||
| 70 | |||
| 71 | sed -e "s:%DB_USER%:${DB_USER}:g" -i ${WORKDIR}/nova.conf | ||
| 72 | sed -e "s:%DB_PASSWORD%:${DB_PASSWORD}:g" -i ${WORKDIR}/nova.conf | ||
| 73 | |||
| 74 | sed -e "s:%CONTROLLER_IP%:${CONTROLLER_IP}:g" -i ${WORKDIR}/nova.conf | ||
| 75 | sed -e "s:%CONTROLLER_HOST%:${CONTROLLER_HOST}:g" -i ${WORKDIR}/nova.conf | ||
| 76 | |||
| 77 | sed -e "s:%COMPUTE_IP%:${COMPUTE_IP}:g" -i ${WORKDIR}/nova.conf | ||
| 78 | sed -e "s:%COMPUTE_HOST%:${COMPUTE_HOST}:g" -i ${WORKDIR}/nova.conf | ||
| 79 | |||
| 80 | sed -e "s:%OS_PASSWORD%:${ADMIN_PASSWORD}:g" -i ${WORKDIR}/openrc | ||
| 81 | sed -e "s:%SERVICE_TOKEN%:${SERVICE_TOKEN}:g" -i ${WORKDIR}/openrc | ||
| 82 | |||
| 83 | sed -e "s:%CONTROLLER_IP%:${CONTROLLER_IP}:g" -i ${WORKDIR}/openrc | ||
| 84 | sed -e "s:%CONTROLLER_HOST%:${CONTROLLER_HOST}:g" -i ${WORKDIR}/openrc | ||
| 85 | |||
| 86 | # Copy the configuration file | ||
| 87 | install -m 664 ${WORKDIR}/nova.conf ${NOVA_CONF_DIR}/nova.conf | ||
| 88 | install -m 664 ${WORKDIR}/api-paste.ini ${NOVA_CONF_DIR} | ||
| 89 | install -m 664 ${WORKDIR}/openrc ${NOVA_CONF_DIR} | ||
| 90 | |||
| 91 | install -d ${NOVA_CONF_DIR}/instances | ||
| 92 | |||
| 93 | if ${@base_contains('DISTRO_FEATURES', 'sysvinit', 'true', 'false', d)}; then | ||
| 94 | install -d ${D}${sysconfdir}/init.d | ||
| 95 | install -m 0755 ${WORKDIR}/nova-all ${D}${sysconfdir}/init.d/nova-all | ||
| 96 | install -m 0755 ${WORKDIR}/nova-consoleauth ${D}${sysconfdir}/init.d/nova-consoleauth | ||
| 97 | install -m 0755 ${WORKDIR}/nova-novncproxy ${D}${sysconfdir}/init.d/nova-novncproxy | ||
| 14 | fi | 98 | fi |
| 15 | } | 99 | } |
| 16 | 100 | ||
| 17 | PACKAGES += "${SRCNAME}-common ${SRCNAME}-common-misc" | 101 | pkg_postinst_${SRCNAME}-controller () { |
| 18 | 102 | if [ "x$D" != "x" ]; then | |
| 19 | #FILES_${PN} = "${files_${PN}}" | 103 | exit 1 |
| 20 | # | 104 | fi |
| 21 | #FILES_${SRCNAME}-common = "${files_${SRCNAME}-common}" | ||
| 22 | # | ||
| 23 | #FILES_${SRCNAME}-common-misc = "${files_${SRCNAME}-compute} ${files_${SRCNAME}-controller}" | ||
| 24 | 105 | ||
| 25 | FILES_${PN} = "${libdir}/python*" | 106 | # This is to make sure postgres is configured and running |
| 107 | if ! pidof postmaster > /dev/null; then | ||
| 108 | /etc/init.d/postgresql-init | ||
| 109 | /etc/init.d/postgresql start | ||
| 110 | sleep 5 | ||
| 111 | fi | ||
| 26 | 112 | ||
| 27 | FILES_${SRCNAME}-common = " \ | 113 | sudo -u postgres createdb nova |
| 28 | ${bindir}/nova-manage \ | 114 | sleep 2 |
| 29 | ${bindir}/nova-rootwrap \ | 115 | nova-manage db sync |
| 30 | ${sysconfdir}/sudoers.d" | 116 | } |
| 31 | 117 | ||
| 32 | FILES_${SRCNAME}-common-misc = " \ | 118 | pkg_postinst_${SRCNAME}-common () { |
| 33 | ${bindir}/nova-compute \ | 119 | if [ "x$D" != "x" ]; then |
| 34 | ${sysconfdir}/${SRCNAME}/* \ | 120 | exit 1 |
| 35 | ${sysconfdir}/init.d/nova-compute \ | 121 | fi |
| 36 | ${bindir} \ | ||
| 37 | ${sysconfdir}/init.d/nova-all" | ||
| 38 | 122 | ||
| 39 | RDEPENDS_${SRCNAME}-common = "${PN} openssl openssl-misc libxml2 libxslt \ | 123 | if [ -d /home/root ]; then |
| 40 | iptables curl dnsmasq sudo procps" | 124 | echo "source /etc/nova/openrc" > /home/root/.bashrc |
| 125 | else | ||
| 126 | echo "source /etc/nova/openrc" > /root/.bashrc | ||
| 127 | fi | ||
| 128 | } | ||
| 41 | 129 | ||
| 42 | USERADD_PACKAGES = "${PN}" | 130 | USERADD_PACKAGES = "${PN}" |
| 43 | GROUPADD_PARAM_${PN} = "--system nova" | 131 | GROUPADD_PARAM_${PN} = "--system nova" |
| 44 | USERADD_PARAM_${PN} = "--system --home /var/lib/nova -g nova \ | 132 | USERADD_PARAM_${PN} = "--system --home /var/lib/nova -g nova \ |
| 45 | --no-create-home --shell /bin/false nova" | 133 | --no-create-home --shell /bin/false nova" |
| 46 | 134 | ||
| 135 | PACKAGES += " ${SRCNAME}-common ${SRCNAME}-compute ${SRCNAME}-controller" | ||
| 136 | PACKAGES += " ${SRCNAME}-consoleauth" | ||
| 137 | PACKAGES += " ${SRCNAME}-novncproxy" | ||
| 138 | |||
| 139 | |||
| 140 | FILES_${PN} = "${libdir}/*" | ||
| 141 | |||
| 142 | FILES_${SRCNAME}-common = "${bindir}/nova-manage \ | ||
| 143 | ${bindir}/nova-rootwrap \ | ||
| 144 | ${sysconfdir}/${SRCNAME}/* \ | ||
| 145 | ${sysconfdir}/sudoers.d" | ||
| 146 | |||
| 147 | FILES_${SRCNAME}-compute = "${bindir}/nova-compute \ | ||
| 148 | ${sysconfdir}/init.d/nova-compute" | ||
| 149 | |||
| 150 | FILES_${SRCNAME}-controller = "${bindir}/* \ | ||
| 151 | ${sysconfdir}/init.d/nova-all " | ||
| 152 | |||
| 153 | FILES_${SRCNAME}-consoleauth = " \ | ||
| 154 | ${sysconfdir}/init.d/nova-consoleauth \ | ||
| 155 | " | ||
| 156 | FILES_${SRCNAME}-novncproxy = " \ | ||
| 157 | ${sysconfdir}/init.d/nova-novncproxy \ | ||
| 158 | " | ||
| 159 | |||
| 47 | RDEPENDS_${PN} = " python-modules \ | 160 | RDEPENDS_${PN} = " python-modules \ |
| 48 | python-misc \ | 161 | python-misc \ |
| 49 | python-argparse \ | 162 | python-argparse \ |
| @@ -79,3 +192,19 @@ RDEPENDS_${PN} = " python-modules \ | |||
| 79 | python-webob \ | 192 | python-webob \ |
| 80 | python-websockify \ | 193 | python-websockify \ |
| 81 | " | 194 | " |
| 195 | |||
| 196 | RDEPENDS_${SRCNAME}-common = "${PN} openssl openssl-misc libxml2 libxslt \ | ||
| 197 | iptables curl dnsmasq sudo procps" | ||
| 198 | |||
| 199 | RDEPENDS_${SRCNAME}-controller = "${PN} ${SRCNAME}-common \ | ||
| 200 | ${SRCNAME}-consoleauth \ | ||
| 201 | ${SRCNAME}-novncproxy \ | ||
| 202 | postgresql postgresql-client python-psycopg2" | ||
| 203 | |||
| 204 | RDEPENDS_${SRCNAME}-compute = "${PN} ${SRCNAME}-common \ | ||
| 205 | qemu libvirt libvirt-libvirtd libvirt-python libvirt-virsh" | ||
| 206 | |||
| 207 | INITSCRIPT_PACKAGES = "${SRCNAME}-controller ${SRCNAME}-consoleauth ${SRCNAME}-novncproxy" | ||
| 208 | INITSCRIPT_NAME_${SRCNAME}-controller = "nova-all" | ||
| 209 | INITSCRIPT_NAME_${SRCNAME}-consoleauth = "nova-consoleauth" | ||
| 210 | INITSCRIPT_NAME_${SRCNAME}-novncproxy = "nova-novncproxy" | ||
