diff options
| author | Bruce Ashfield <bruce.ashfield@windriver.com> | 2013-10-30 00:14:31 -0400 |
|---|---|---|
| committer | Bruce Ashfield <bruce.ashfield@windriver.com> | 2013-11-25 15:25:34 -0500 |
| commit | 0a962a285a529def3d3649544214bc36c9292d18 (patch) | |
| tree | bea41c69fd5d0f8186ddf47bf2c08d756a8e323a /meta-openstack/recipes-devtools/python/python-nova_git.bb | |
| parent | 8dc56b2f821762f2051cee4bf5b4123e821ae212 (diff) | |
| download | meta-cloud-services-0a962a285a529def3d3649544214bc36c9292d18.tar.gz | |
nova: uprev to havana release version
This commit uprevs the nova component to the havana release version, and
switches the build from tarballs to using the git repository. No other
runtime changes are made at this point.`
Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com>
Diffstat (limited to 'meta-openstack/recipes-devtools/python/python-nova_git.bb')
| -rw-r--r-- | meta-openstack/recipes-devtools/python/python-nova_git.bb | 212 |
1 files changed, 212 insertions, 0 deletions
diff --git a/meta-openstack/recipes-devtools/python/python-nova_git.bb b/meta-openstack/recipes-devtools/python/python-nova_git.bb new file mode 100644 index 0000000..4c57095 --- /dev/null +++ b/meta-openstack/recipes-devtools/python/python-nova_git.bb | |||
| @@ -0,0 +1,212 @@ | |||
| 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 | PR = "r0" | ||
| 10 | SRCNAME = "nova" | ||
| 11 | |||
| 12 | FILESEXTRAPATHS := "${THISDIR}/${PN}" | ||
| 13 | |||
| 14 | SRC_URI = "git://github.com/openstack/nova.git;branch=stable/havana \ | ||
| 15 | file://0001-nova-api-paste.ini-make-controller-IP-configurable.patch \ | ||
| 16 | " | ||
| 17 | |||
| 18 | SRC_URI += "file://nova-all \ | ||
| 19 | file://nova-compute \ | ||
| 20 | file://nova-consoleauth \ | ||
| 21 | file://nova-novncproxy \ | ||
| 22 | file://nova.conf \ | ||
| 23 | file://openrc \ | ||
| 24 | " | ||
| 25 | SRCREV="88cfe5a0ae682794f8ce25b787084115925023f2" | ||
| 26 | PV="2013.2+git${SRCPV}" | ||
| 27 | |||
| 28 | S = "${WORKDIR}/git" | ||
| 29 | |||
| 30 | inherit update-rc.d setuptools identity hosts useradd | ||
| 31 | |||
| 32 | do_install_append() { | ||
| 33 | if [ ! -f "${WORKDIR}/nova.conf" ]; then | ||
| 34 | return | ||
| 35 | fi | ||
| 36 | |||
| 37 | TEMPLATE_CONF_DIR=${S}${sysconfdir}/${SRCNAME} | ||
| 38 | NOVA_CONF_DIR=${D}/${sysconfdir}/nova | ||
| 39 | |||
| 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-compute ${D}${sysconfdir}/init.d/nova-compute | ||
| 97 | install -m 0755 ${WORKDIR}/nova-consoleauth ${D}${sysconfdir}/init.d/nova-consoleauth | ||
| 98 | install -m 0755 ${WORKDIR}/nova-novncproxy ${D}${sysconfdir}/init.d/nova-novncproxy | ||
| 99 | fi | ||
| 100 | } | ||
| 101 | |||
| 102 | pkg_postinst_${SRCNAME}-controller () { | ||
| 103 | if [ "x$D" != "x" ]; then | ||
| 104 | exit 1 | ||
| 105 | fi | ||
| 106 | |||
| 107 | # This is to make sure postgres is configured and running | ||
| 108 | if ! pidof postmaster > /dev/null; then | ||
| 109 | /etc/init.d/postgresql-init | ||
| 110 | /etc/init.d/postgresql start | ||
| 111 | sleep 5 | ||
| 112 | fi | ||
| 113 | |||
| 114 | sudo -u postgres createdb nova | ||
| 115 | sleep 2 | ||
| 116 | nova-manage db sync | ||
| 117 | } | ||
| 118 | |||
| 119 | pkg_postinst_${SRCNAME}-common () { | ||
| 120 | if [ "x$D" != "x" ]; then | ||
| 121 | exit 1 | ||
| 122 | fi | ||
| 123 | |||
| 124 | if [ -d /home/root ]; then | ||
| 125 | echo "source /etc/nova/openrc" > /home/root/.bashrc | ||
| 126 | else | ||
| 127 | echo "source /etc/nova/openrc" > /root/.bashrc | ||
| 128 | fi | ||
| 129 | } | ||
| 130 | |||
| 131 | USERADD_PACKAGES = "${PN}" | ||
| 132 | GROUPADD_PARAM_${PN} = "--system nova" | ||
| 133 | USERADD_PARAM_${PN} = "--system --home /var/lib/nova -g nova \ | ||
| 134 | --no-create-home --shell /bin/false nova" | ||
| 135 | |||
| 136 | PACKAGES += " ${SRCNAME}-common ${SRCNAME}-compute ${SRCNAME}-controller" | ||
| 137 | PACKAGES += " ${SRCNAME}-consoleauth" | ||
| 138 | PACKAGES += " ${SRCNAME}-novncproxy" | ||
| 139 | |||
| 140 | |||
| 141 | FILES_${PN} = "${libdir}/*" | ||
| 142 | |||
| 143 | FILES_${SRCNAME}-common = "${bindir}/nova-manage \ | ||
| 144 | ${bindir}/nova-rootwrap \ | ||
| 145 | ${sysconfdir}/${SRCNAME}/* \ | ||
| 146 | ${sysconfdir}/sudoers.d" | ||
| 147 | |||
| 148 | FILES_${SRCNAME}-compute = "${bindir}/nova-compute \ | ||
| 149 | ${sysconfdir}/init.d/nova-compute" | ||
| 150 | |||
| 151 | FILES_${SRCNAME}-controller = "${bindir}/* \ | ||
| 152 | ${sysconfdir}/init.d/nova-all " | ||
| 153 | |||
| 154 | FILES_${SRCNAME}-consoleauth = " \ | ||
| 155 | ${sysconfdir}/init.d/nova-consoleauth \ | ||
| 156 | " | ||
| 157 | FILES_${SRCNAME}-novncproxy = " \ | ||
| 158 | ${sysconfdir}/init.d/nova-novncproxy \ | ||
| 159 | " | ||
| 160 | |||
| 161 | RDEPENDS_${PN} = " python-modules \ | ||
| 162 | python-misc \ | ||
| 163 | python-argparse \ | ||
| 164 | python-amqplib \ | ||
| 165 | python-anyjson \ | ||
| 166 | python-babel \ | ||
| 167 | python-boto \ | ||
| 168 | python-cinderclient \ | ||
| 169 | python-cheetah \ | ||
| 170 | python-eventlet \ | ||
| 171 | python-feedparser \ | ||
| 172 | python-glanceclient \ | ||
| 173 | python-greenlet \ | ||
| 174 | python-httplib2 \ | ||
| 175 | python-iso8601 \ | ||
| 176 | python-kombu \ | ||
| 177 | python-lxml \ | ||
| 178 | python-netaddr \ | ||
| 179 | python-oslo.config \ | ||
| 180 | python-paste \ | ||
| 181 | python-pastedeploy \ | ||
| 182 | python-paramiko \ | ||
| 183 | python-pyasn1 \ | ||
| 184 | python-setuptools-git \ | ||
| 185 | python-simplejson \ | ||
| 186 | python-setuptools \ | ||
| 187 | python-sqlalchemy \ | ||
| 188 | python-sqlalchemy-migrate \ | ||
| 189 | python-stevedore \ | ||
| 190 | python-suds \ | ||
| 191 | python-quantumclient \ | ||
| 192 | python-routes \ | ||
| 193 | python-webob \ | ||
| 194 | python-websockify \ | ||
| 195 | " | ||
| 196 | |||
| 197 | RDEPENDS_${SRCNAME}-common = "${PN} openssl openssl-misc libxml2 libxslt \ | ||
| 198 | iptables curl dnsmasq sudo procps" | ||
| 199 | |||
| 200 | RDEPENDS_${SRCNAME}-controller = "${PN} ${SRCNAME}-common \ | ||
| 201 | ${SRCNAME}-consoleauth \ | ||
| 202 | ${SRCNAME}-novncproxy \ | ||
| 203 | postgresql postgresql-client python-psycopg2" | ||
| 204 | |||
| 205 | RDEPENDS_${SRCNAME}-compute = "${PN} ${SRCNAME}-common \ | ||
| 206 | qemu libvirt libvirt-libvirtd libvirt-python libvirt-virsh" | ||
| 207 | |||
| 208 | INITSCRIPT_PACKAGES = "${SRCNAME}-compute ${SRCNAME}-controller ${SRCNAME}-consoleauth ${SRCNAME}-novncproxy" | ||
| 209 | INITSCRIPT_NAME_${SRCNAME}-controller = "nova-all" | ||
| 210 | INITSCRIPT_NAME_${SRCNAME}-compute = "nova-compute" | ||
| 211 | INITSCRIPT_NAME_${SRCNAME}-consoleauth = "nova-consoleauth" | ||
| 212 | INITSCRIPT_NAME_${SRCNAME}-novncproxy = "nova-novncproxy" | ||
