summaryrefslogtreecommitdiffstats
path: root/meta-openstack/recipes-devtools/python/python-nova_2013.1.3.bb
diff options
context:
space:
mode:
authorBruce Ashfield <bruce.ashfield@windriver.com>2013-08-25 23:59:46 -0400
committerBruce Ashfield <bruce.ashfield@windriver.com>2013-08-28 18:42:00 -0400
commit6e8b7c9fb262768cb89712948b9fadf461e472ba (patch)
treed29fc8dd1b43815e3892ab28b2c1a05333359ef3 /meta-openstack/recipes-devtools/python/python-nova_2013.1.3.bb
parentec5aab41b280d719c14e1c5d88d09e7b38168bb3 (diff)
downloadmeta-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_2013.1.3.bb')
-rw-r--r--meta-openstack/recipes-devtools/python/python-nova_2013.1.3.bb134
1 files changed, 12 insertions, 122 deletions
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 95065fc..c10bebb 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,88 +1,6 @@
1DESCRIPTION = "Nova is a cloud computing fabric controller" 1include python-nova.inc
2HOMEPAGE = "https://launchpad.net/nova"
3SECTION = "devel/python"
4LICENSE = "Apache-2.0"
5LIC_FILES_CHKSUM = "file://LICENSE;md5=1dece7821bf3fd70fe1309eaa37d52a2"
6 2
7DEPENDS = "sudo" 3inherit useradd
8
9PR = "r0"
10SRCNAME = "nova"
11
12SRC_URI = "https://launchpad.net/${SRCNAME}/grizzly/${PV}/+download/${SRCNAME}-${PV}.tar.gz \
13 file://nova.conf \
14 file://nova-compute \
15 file://nova-all \
16 file://openrc \
17 "
18SRC_URI[md5sum] = "6215982b9ed08b9042e088470d60a0a6"
19SRC_URI[sha256sum] = "f7c25186920daccb16867c5fd272318beb8cc076e5a55f79b5906618ef2724f4"
20
21S = "${WORKDIR}/${SRCNAME}-${PV}"
22
23inherit setuptools useradd update-rc.d identity
24
25do_install_append() {
26 TEMPLATE_CONF_DIR=${S}${sysconfdir}/${SRCNAME}
27 NOVA_CONF_DIR=${D}/${sysconfdir}/nova
28
29 install -d ${NOVA_CONF_DIR}
30 install -m 600 ${S}/etc/nova/policy.json ${NOVA_CONF_DIR}/
31
32 # Deploy filters to /etc/nova/rootwrap.d
33 install -m 755 -d ${NOVA_CONF_DIR}/rootwrap.d
34 install -m 600 ${S}/etc/nova/rootwrap.d/*.filters ${NOVA_CONF_DIR}/rootwrap.d
35 chown -R root:root ${NOVA_CONF_DIR}/rootwrap.d
36 chmod 644 ${NOVA_CONF_DIR}/rootwrap.d
37
38 # Set up rootwrap.conf, pointing to /etc/nova/rootwrap.d
39 install -m 644 ${S}/etc/nova/rootwrap.conf ${NOVA_CONF_DIR}/
40 sed -e "s:^filters_path=.*$:filters_path=${NOVA_CONF_DIR}/rootwrap.d:" \
41 -i ${NOVA_CONF_DIR}/rootwrap.conf
42 chown root:root $NOVA_CONF_DIR/rootwrap.conf
43
44 # Set up the rootwrap sudoers for nova
45 install -d ${D}${sysconfdir}/sudoers.d
46 touch ${D}${sysconfdir}/sudoers.d/nova-rootwrap
47 chmod 0440 ${D}${sysconfdir}/sudoers.d/nova-rootwrap
48 chown root:root ${D}${sysconfdir}/sudoers.d/nova-rootwrap
49 echo "root ALL=(root) NOPASSWD: ${bindir}/nova-rootwrap" > \
50 ${D}${sysconfdir}/sudoers.d/nova-rootwrap
51
52 #Configuration options
53 sed -e "s:%SERVICE_TENANT_NAME%:${SERVICE_TENANT_NAME}:g" \
54 ${TEMPLATE_CONF_DIR}/api-paste.ini > ${WORKDIR}/api-paste.ini
55 sed -e "s:%SERVICE_USER%:${SRCNAME}:g" -i ${WORKDIR}/api-paste.ini
56 sed -e "s:%SERVICE_PASSWORD%:${SERVICE_PASSWORD}:g" \
57 -i ${WORKDIR}/api-paste.ini
58
59 sed -e "s:%DB_USER%:${DB_USER}:g" -i ${WORKDIR}/nova.conf
60 sed -e "s:%DB_PASSWORD%:${DB_PASSWORD}:g" -i ${WORKDIR}/nova.conf
61
62 sed -e "s:%OS_PASSWORD%:${ADMIN_PASSWORD}:g" -i ${WORKDIR}/openrc
63 sed -e "s:%SERVICE_TOKEN%:${SERVICE_TOKEN}:g" -i ${WORKDIR}/openrc
64
65 #Copy the configuration file
66 install -m 664 ${WORKDIR}/nova.conf ${NOVA_CONF_DIR}/nova.conf
67 install -m 664 ${WORKDIR}/api-paste.ini ${NOVA_CONF_DIR}
68 install -m 664 ${WORKDIR}/openrc ${NOVA_CONF_DIR}
69
70 install -d ${NOVA_CONF_DIR}/instances
71
72 if ${@base_contains('DISTRO_FEATURES', 'sysvinit', 'true', 'false', d)}; then
73 install -d ${D}${sysconfdir}/init.d
74 install -m 0755 ${WORKDIR}/nova-compute ${D}${sysconfdir}/init.d/nova-compute
75 install -m 0755 ${WORKDIR}/nova-all ${D}${sysconfdir}/init.d/nova-all
76 fi
77
78}
79
80USERADD_PACKAGES = "${PN}"
81GROUPADD_PARAM_${PN} = "--system nova"
82USERADD_PARAM_${PN} = "--system --home /var/lib/nova -g nova \
83 --no-create-home --shell /bin/false nova"
84
85PACKAGES += "${SRCNAME}-common ${SRCNAME}-compute ${SRCNAME}-controller"
86 4
87pkg_postinst_${SRCNAME}-common () { 5pkg_postinst_${SRCNAME}-common () {
88 if [ "x$D" != "x" ]; then 6 if [ "x$D" != "x" ]; then
@@ -92,36 +10,21 @@ pkg_postinst_${SRCNAME}-common () {
92 echo "source /etc/nova/openrc" > /home/root/.bashrc 10 echo "source /etc/nova/openrc" > /home/root/.bashrc
93} 11}
94 12
95pkg_postinst_${SRCNAME}-controller () { 13PACKAGES += "${SRCNAME}-common ${SRCNAME}-common-misc"
96 if [ "x$D" != "x" ]; then
97 exit 1
98 fi
99 14
100 # This is to make sure postgres is configured and running 15FILES_${PN} = "${files_${PN}}"
101 if ! pidof postmaster > /dev/null; then
102 sudo -u postgres initdb -D /etc/postgresql/
103 /etc/init.d/postgresql start
104 sleep 0.2
105 sudo -u postgres psql -c "CREATE ROLE ${DB_USER} WITH SUPERUSER LOGIN PASSWORD '${DB_PASSWORD}'"
106 fi
107 16
108 sudo -u postgres createdb nova 17FILES_${SRCNAME}-common = "${files_${SRCNAME}-common}"
109 nova-manage db sync
110}
111
112
113FILES_${PN} = "${libdir}/*"
114 18
115FILES_${SRCNAME}-common = " ${bindir}/nova-manage \ 19FILES_${SRCNAME}-common-misc = "${files_${SRCNAME}-compute} ${files_${SRCNAME}-controller}"
116 ${bindir}/nova-rootwrap \
117 ${sysconfdir}/${SRCNAME}/* \
118 ${sysconfdir}/sudoers.d"
119 20
120FILES_${SRCNAME}-compute = "${bindir}/nova-compute \ 21RDEPENDS_${SRCNAME}-common = "${PN} openssl openssl-misc libxml2 libxslt \
121 ${sysconfdir}/init.d/nova-compute" 22 iptables curl dnsmasq sudo procps"
122 23
123FILES_${SRCNAME}-controller = "${bindir}/* \ 24USERADD_PACKAGES = "${PN}"
124 ${sysconfdir}/init.d/nova-all" 25GROUPADD_PARAM_${PN} = "--system nova"
26USERADD_PARAM_${PN} = "--system --home /var/lib/nova -g nova \
27 --no-create-home --shell /bin/false nova"
125 28
126RDEPENDS_${PN} = " python-modules \ 29RDEPENDS_${PN} = " python-modules \
127 python-misc \ 30 python-misc \
@@ -158,16 +61,3 @@ RDEPENDS_${PN} = " python-modules \
158 python-webob \ 61 python-webob \
159 python-websockify \ 62 python-websockify \
160 " 63 "
161
162RDEPENDS_${SRCNAME}-common = "${PN} openssl openssl-misc libxml2 libxslt \
163 iptables curl dnsmasq sudo procps"
164
165RDEPENDS_${SRCNAME}-compute = "${PN} nova-common \
166 qemu libvirt libvirt-libvirtd libvirt-python libvirt-virsh"
167
168RDEPENDS_${SRCNAME}-controller = "${PN} nova-common \
169 postgresql postgresql-client python-psycopg2"
170
171INITSCRIPT_PACKAGES = "${SRCNAME}-compute ${SRCNAME}-controller"
172INITSCRIPT_NAME_${SRCNAME}-compute = "nova-compute"
173INITSCRIPT_NAME_${SRCNAME}-controller = "nova-all"