aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBruce Ashfield <bruce.ashfield@windriver.com>2013-10-02 09:24:42 -0400
committerBruce Ashfield <bruce.ashfield@windriver.com>2013-10-03 01:15:42 -0400
commitd55da8ead69d11ca6f4b0009e010ef32ccab900e (patch)
treeb7616ada094784588ddd663737e08e36921283e2
parentcfb803391031a0b7f5971df14d1616bc3e3d8c07 (diff)
downloadmeta-cloud-services-d55da8ead69d11ca6f4b0009e010ef32ccab900e.tar.gz
meta-cloud-services-d55da8ead69d11ca6f4b0009e010ef32ccab900e.tar.bz2
meta-cloud-services-d55da8ead69d11ca6f4b0009e010ef32ccab900e.zip
postgresql: enable global listening, and explicit IP permissions
To allow better out of the box configuration of postgresql, two things are required: listen on all addresses, and add explicit permissions for the known nodes in the network. In this change, the former is done by adding listen_addresses = '*' to the generated postgresql configuration on first boot, as well as adding the known compute and controller IPs to pg_hba.conf. (note: the values for these IPs come from hosts.bbclass) Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com>
-rw-r--r--meta-openstack/recipes-support/postgresql/postgresql_9.2.4.bbappend6
1 files changed, 5 insertions, 1 deletions
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 f131e21..7c28fa1 100644
--- a/meta-openstack/recipes-support/postgresql/postgresql_9.2.4.bbappend
+++ b/meta-openstack/recipes-support/postgresql/postgresql_9.2.4.bbappend
@@ -3,7 +3,7 @@ PRINC := "${@int(PRINC) + 1}"
SRC_URI += "file://postgresql"
-inherit useradd update-rc.d identity
+inherit useradd update-rc.d identity hosts
do_install_append() {
install -d ${D}${sysconfdir}/${PN}
@@ -26,6 +26,10 @@ pkg_postinst_${PN} () {
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