aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--meta-openstack-qemu/recipes-devtools/python/python-nova-controller_2013.1.3.bbappend11
-rw-r--r--meta-openstack-qemu/recipes-devtools/python/python-nova_2013.1.3.bbappend (renamed from meta-openstack-qemu/recipes-devtools/python/python-nova-compute_2013.1.3.bbappend)0
-rw-r--r--meta-openstack/recipes-devtools/python/python-cinder_2013.1.3.bb4
-rw-r--r--meta-openstack/recipes-devtools/python/python-glance_2013.1.3.bb5
-rw-r--r--meta-openstack/recipes-devtools/python/python-keystone_2013.1.3.bb4
-rw-r--r--meta-openstack/recipes-devtools/python/python-nova_2013.1.3.bb13
-rw-r--r--meta-openstack/recipes-devtools/python/python-quantum_2013.1.3.bb5
-rw-r--r--meta-openstack/recipes-support/postgresql/postgresql/postgresql-init46
-rw-r--r--meta-openstack/recipes-support/postgresql/postgresql_9.2.4.bbappend46
9 files changed, 76 insertions, 58 deletions
diff --git a/meta-openstack-qemu/recipes-devtools/python/python-nova-controller_2013.1.3.bbappend b/meta-openstack-qemu/recipes-devtools/python/python-nova-controller_2013.1.3.bbappend
deleted file mode 100644
index f45a02bf..00000000
--- a/meta-openstack-qemu/recipes-devtools/python/python-nova-controller_2013.1.3.bbappend
+++ /dev/null
@@ -1,11 +0,0 @@
-do_install_append() {
- if [ ! -f "${WORKDIR}/nova.conf" ]; then
- return
- fi
-
- TEMPLATE_CONF_DIR=${S}${sysconfdir}/${SRCNAME}
- NOVA_CONF_DIR=${D}/${sysconfdir}/nova
-
- sed -e "s:^libvirt_type.*=.*$:libvirt_type = qemu:" \
- -i ${NOVA_CONF_DIR}/nova.conf
-} \ No newline at end of file
diff --git a/meta-openstack-qemu/recipes-devtools/python/python-nova-compute_2013.1.3.bbappend b/meta-openstack-qemu/recipes-devtools/python/python-nova_2013.1.3.bbappend
index 45f4307b..45f4307b 100644
--- a/meta-openstack-qemu/recipes-devtools/python/python-nova-compute_2013.1.3.bbappend
+++ b/meta-openstack-qemu/recipes-devtools/python/python-nova_2013.1.3.bbappend
diff --git a/meta-openstack/recipes-devtools/python/python-cinder_2013.1.3.bb b/meta-openstack/recipes-devtools/python/python-cinder_2013.1.3.bb
index 1cdcd98f..a6a10e53 100644
--- a/meta-openstack/recipes-devtools/python/python-cinder_2013.1.3.bb
+++ b/meta-openstack/recipes-devtools/python/python-cinder_2013.1.3.bb
@@ -57,10 +57,8 @@ pkg_postinst_${SRCNAME} () {
# 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-init
/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 cinder
diff --git a/meta-openstack/recipes-devtools/python/python-glance_2013.1.3.bb b/meta-openstack/recipes-devtools/python/python-glance_2013.1.3.bb
index 9bfd2624..ff81a0c7 100644
--- a/meta-openstack/recipes-devtools/python/python-glance_2013.1.3.bb
+++ b/meta-openstack/recipes-devtools/python/python-glance_2013.1.3.bb
@@ -65,10 +65,9 @@ pkg_postinst_${SRCNAME} () {
# 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-init
/etc/init.d/postgresql start
- sleep 0.2
- sudo -u postgres psql -c "CREATE ROLE ${DB_USER} WITH SUPERUSER LOGIN PASSWORD '${DB_PASSWORD}'"
+ sleep 5
fi
mkdir /var/log/glance
diff --git a/meta-openstack/recipes-devtools/python/python-keystone_2013.1.3.bb b/meta-openstack/recipes-devtools/python/python-keystone_2013.1.3.bb
index e1245837..387fa68c 100644
--- a/meta-openstack/recipes-devtools/python/python-keystone_2013.1.3.bb
+++ b/meta-openstack/recipes-devtools/python/python-keystone_2013.1.3.bb
@@ -58,11 +58,9 @@ pkg_postinst_${SRCNAME} () {
# This is to make sure postgres is configured and running
if ! pidof postmaster > /dev/null; then
- sudo -u postgres initdb -D /etc/postgresql/
- sleep 10
+ /etc/init.d/postgresql-init
/etc/init.d/postgresql start
sleep 5
- sudo -u postgres psql -c "CREATE ROLE ${DB_USER} WITH SUPERUSER LOGIN PASSWORD '${DB_PASSWORD}'"
fi
sudo -u postgres createdb keystone
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 c2dd1f3f..35525923 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
@@ -16,6 +16,7 @@ SRC_URI = "https://launchpad.net/${SRCNAME}/grizzly/${PV}/+download/${SRCNAME}-$
"
SRC_URI += "file://nova-all \
+ file://nova-compute \
file://nova-consoleauth \
file://nova-novncproxy \
file://nova.conf \
@@ -93,6 +94,7 @@ 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
+ install -m 0755 ${WORKDIR}/nova-compute ${D}${sysconfdir}/init.d/nova-compute
install -m 0755 ${WORKDIR}/nova-consoleauth ${D}${sysconfdir}/init.d/nova-consoleauth
install -m 0755 ${WORKDIR}/nova-novncproxy ${D}${sysconfdir}/init.d/nova-novncproxy
fi
@@ -197,14 +199,15 @@ RDEPENDS_${SRCNAME}-common = "${PN} openssl openssl-misc libxml2 libxslt \
iptables curl dnsmasq sudo procps"
RDEPENDS_${SRCNAME}-controller = "${PN} ${SRCNAME}-common \
- ${SRCNAME}-consoleauth \
- ${SRCNAME}-novncproxy \
- postgresql postgresql-client python-psycopg2"
+ ${SRCNAME}-consoleauth \
+ ${SRCNAME}-novncproxy \
+ postgresql postgresql-client python-psycopg2"
RDEPENDS_${SRCNAME}-compute = "${PN} ${SRCNAME}-common \
- qemu libvirt libvirt-libvirtd libvirt-python libvirt-virsh"
+ qemu libvirt libvirt-libvirtd libvirt-python libvirt-virsh"
-INITSCRIPT_PACKAGES = "${SRCNAME}-controller ${SRCNAME}-consoleauth ${SRCNAME}-novncproxy"
+INITSCRIPT_PACKAGES = "${SRCNAME}-compute ${SRCNAME}-controller ${SRCNAME}-consoleauth ${SRCNAME}-novncproxy"
INITSCRIPT_NAME_${SRCNAME}-controller = "nova-all"
+INITSCRIPT_NAME_${SRCNAME}-compute = "nova-compute"
INITSCRIPT_NAME_${SRCNAME}-consoleauth = "nova-consoleauth"
INITSCRIPT_NAME_${SRCNAME}-novncproxy = "nova-novncproxy"
diff --git a/meta-openstack/recipes-devtools/python/python-quantum_2013.1.3.bb b/meta-openstack/recipes-devtools/python/python-quantum_2013.1.3.bb
index 34da3c9a..8198e6a1 100644
--- a/meta-openstack/recipes-devtools/python/python-quantum_2013.1.3.bb
+++ b/meta-openstack/recipes-devtools/python/python-quantum_2013.1.3.bb
@@ -74,10 +74,9 @@ pkg_postinst_${SRCNAME} () {
# 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-init
/etc/init.d/postgresql start
- sleep 0.2
- sudo -u postgres psql -c "CREATE ROLE ${DB_USER} WITH SUPERUSER LOGIN PASSWORD '${DB_PASSWORD}'"
+ sleep 5
fi
sudo -u postgres createdb ovs_quantum
diff --git a/meta-openstack/recipes-support/postgresql/postgresql/postgresql-init b/meta-openstack/recipes-support/postgresql/postgresql/postgresql-init
new file mode 100644
index 00000000..d9850dab
--- /dev/null
+++ b/meta-openstack/recipes-support/postgresql/postgresql/postgresql-init
@@ -0,0 +1,46 @@
+#!/bin/sh
+# set -x
+
+PN=postgresql
+CONTROLLER_IP=%CONTROLLER_IP%
+COMPUTE_IP=%COMPUTE_IP%
+DB_USER=%DB_USER%
+DB_PASSWORD=%DB_PASSWORD%
+
+if [ -e /etc/${PN}/PG_VERSION ]; then
+ # the database has already been initialized, return
+ exit 0
+fi
+
+sudo -u postgres initdb -D /etc/${PN}/
+sleep 2
+echo "listen_addresses = '*'" >> /etc/${PN}/postgresql.conf
+echo "host all all ${CONTROLLER_IP}/32 trust" >> /etc/${PN}/pg_hba.conf
+echo "host all all ${COMPUTE_IP}/32 trust" >> /etc/${PN}/pg_hba.conf
+sleep 2
+/etc/init.d/postgresql start
+sleep 10
+
+count=0
+done=0
+while [ $count -le 10 ] && [ $done -eq 0 ]; do
+ sudo -u postgres psql -c "CREATE ROLE ${DB_USER} WITH SUPERUSER LOGIN PASSWORD '${DB_PASSWORD}'" 2> /dev/null
+ if [ $? -ne 0 ]; then
+ echo "[INFO] postgres: failed to create account for ${DB_USER}, trying again"
+ /etc/init.d/postgresql stop
+ sleep 3
+ /etc/init.d/postgresql start
+ sleep 3
+ else
+ echo "[INFO] postgres: created account for ${DB_USER}, continuing .. "
+ done=1
+ fi
+ count=`expr $count + 1`
+done
+
+if [ $done -eq 0 ]; then
+ echo "[ERROR] postgres: unable to create admin account"
+ exit 1
+fi
+
+ln -s /usr/share/zoneinfo /usr/share/postgresql/timezone
diff --git a/meta-openstack/recipes-support/postgresql/postgresql_9.2.4.bbappend b/meta-openstack/recipes-support/postgresql/postgresql_9.2.4.bbappend
index 7c28fa17..3174e944 100644
--- a/meta-openstack/recipes-support/postgresql/postgresql_9.2.4.bbappend
+++ b/meta-openstack/recipes-support/postgresql/postgresql_9.2.4.bbappend
@@ -1,7 +1,8 @@
FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"
PRINC := "${@int(PRINC) + 1}"
-SRC_URI += "file://postgresql"
+SRC_URI += "file://postgresql \
+ file://postgresql-init"
inherit useradd update-rc.d identity hosts
@@ -11,6 +12,18 @@ do_install_append() {
install -d ${D}${sysconfdir}/init.d/
install -m 0755 ${WORKDIR}/postgresql ${D}${sysconfdir}/init.d/postgresql
+
+ sed -e "s:%DB_USER%:${DB_USER}:g" -i ${WORKDIR}/postgresql-init
+ sed -e "s:%DB_PASSWORD%:${DB_PASSWORD}:g" -i ${WORKDIR}/postgresql-init
+
+ sed -e "s:%CONTROLLER_IP%:${CONTROLLER_IP}:g" -i ${WORKDIR}/postgresql-init
+ sed -e "s:%CONTROLLER_HOST%:${CONTROLLER_HOST}:g" -i ${WORKDIR}/postgresql-init
+
+ sed -e "s:%COMPUTE_IP%:${COMPUTE_IP}:g" -i ${WORKDIR}/postgresql-init
+ sed -e "s:%COMPUTE_HOST%:${COMPUTE_HOST}:g" -i ${WORKDIR}/postgresql-init
+
+ install -m 0755 ${WORKDIR}/postgresql-init ${D}${sysconfdir}/init.d/postgresql-init
+
}
USERADD_PACKAGES = "${PN}"
@@ -24,38 +37,11 @@ pkg_postinst_${PN} () {
exit 1
fi
- sudo -u postgres initdb -D /etc/${PN}/
- sleep 2
- echo "listen_addresses = '*'" >> /etc/${PN}/postgresql.conf
- echo "host all all ${CONTROLLER_IP}/32 trust" >> /etc/${PN}/pg_hba.conf
- echo "host all all ${COMPUTE_IP}/32 trust" >> /etc/${PN}/pg_hba.conf
- sleep 2
- /etc/init.d/postgresql start
- sleep 5
-
- count=0
- done=0
- while [ $count -le 10 ] && [ $done -eq 0 ]; do
- sudo -u postgres psql -c "CREATE ROLE ${DB_USER} WITH SUPERUSER LOGIN PASSWORD '${DB_PASSWORD}'" 2> /dev/null
- if [ $? -ne 0 ]; then
- echo "[INFO] postgres: failed to create account for ${DB_USER}, trying again"
- /etc/init.d/postgresql stop
- sleep 2
- /etc/init.d/postgresql start
- sleep 1
- else
- done=1
- fi
- count=`expr $count + 1`
- done
-
- if [ $done -eq 0 ]; then
+ /etc/init.d/postgresql-init
+ if [ $? -eq 0 ]; then
echo "[ERROR] postgres: unable to create admin account"
exit 1
fi
-
- ln -s /usr/share/zoneinfo /usr/share/postgresql/timezone
- # end postgres 9.2.4 postinst
}
FILES_${PN} += "${localstatedir}/run/${PN}"