diff options
| author | Bruce Ashfield <bruce.ashfield@windriver.com> | 2013-08-25 23:59:46 -0400 |
|---|---|---|
| committer | Bruce Ashfield <bruce.ashfield@windriver.com> | 2013-08-28 18:42:00 -0400 |
| commit | 6e8b7c9fb262768cb89712948b9fadf461e472ba (patch) | |
| tree | d29fc8dd1b43815e3892ab28b2c1a05333359ef3 /meta-openstack/recipes-devtools/python/python-nova.inc | |
| parent | ec5aab41b280d719c14e1c5d88d09e7b38168bb3 (diff) | |
| download | meta-cloud-services-6e8b7c9fb262768cb89712948b9fadf461e472ba.tar.gz | |
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 <bruce.ashfield@windriver.com>
Diffstat (limited to 'meta-openstack/recipes-devtools/python/python-nova.inc')
| -rw-r--r-- | meta-openstack/recipes-devtools/python/python-nova.inc | 99 |
1 files changed, 99 insertions, 0 deletions
diff --git a/meta-openstack/recipes-devtools/python/python-nova.inc b/meta-openstack/recipes-devtools/python/python-nova.inc new file mode 100644 index 0000000..be46460 --- /dev/null +++ b/meta-openstack/recipes-devtools/python/python-nova.inc | |||
| @@ -0,0 +1,99 @@ | |||
| 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=${NOVA_CONF_DIR}/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:%OS_PASSWORD%:${ADMIN_PASSWORD}:g" -i ${WORKDIR}/openrc | ||
| 72 | sed -e "s:%SERVICE_TOKEN%:${SERVICE_TOKEN}:g" -i ${WORKDIR}/openrc | ||
| 73 | |||
| 74 | sed -e "s:%CONTROLLER_IP%:${CONTROLLER_IP}:g" -i ${WORKDIR}/openrc | ||
| 75 | sed -e "s:%CONTROLLER_HOST%:${CONTROLLER_HOST}:g" -i ${WORKDIR}/openrc | ||
| 76 | |||
| 77 | # Copy the configuration file | ||
| 78 | install -m 664 ${WORKDIR}/nova.conf ${NOVA_CONF_DIR}/nova.conf | ||
| 79 | install -m 664 ${WORKDIR}/api-paste.ini ${NOVA_CONF_DIR} | ||
| 80 | install -m 664 ${WORKDIR}/openrc ${NOVA_CONF_DIR} | ||
| 81 | |||
| 82 | install -d ${NOVA_CONF_DIR}/instances | ||
| 83 | } | ||
| 84 | |||
| 85 | # note the lowercase "files", these variables are used in the packaging | ||
| 86 | # recipes themselves. | ||
| 87 | files_${PYTHON_PN} = "${libdir}/*" | ||
| 88 | |||
| 89 | files_${SRCNAME}-common = " ${bindir}/nova-manage \ | ||
| 90 | ${bindir}/nova-rootwrap \ | ||
| 91 | ${sysconfdir}/sudoers.d" | ||
| 92 | |||
| 93 | files_${SRCNAME}-compute = " ${bindir}/nova-compute \ | ||
| 94 | ${sysconfdir}/${SRCNAME}/* \ | ||
| 95 | ${sysconfdir}/init.d/nova-compute" | ||
| 96 | |||
| 97 | files_${SRCNAME}-controller = " ${bindir}/* \ | ||
| 98 | ${sysconfdir}/${SRCNAME}/* \ | ||
| 99 | ${sysconfdir}/init.d/nova-all" \ No newline at end of file | ||
