summaryrefslogtreecommitdiffstats
path: root/meta-openstack/recipes-support/postgresql
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 /meta-openstack/recipes-support/postgresql
parentcfb803391031a0b7f5971df14d1616bc3e3d8c07 (diff)
downloadmeta-cloud-services-d55da8ead69d11ca6f4b0009e010ef32ccab900e.tar.gz
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>
Diffstat (limited to 'meta-openstack/recipes-support/postgresql')
-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}"
3 3
4SRC_URI += "file://postgresql" 4SRC_URI += "file://postgresql"
5 5
6inherit useradd update-rc.d identity 6inherit useradd update-rc.d identity hosts
7 7
8do_install_append() { 8do_install_append() {
9 install -d ${D}${sysconfdir}/${PN} 9 install -d ${D}${sysconfdir}/${PN}
@@ -26,6 +26,10 @@ pkg_postinst_${PN} () {
26 26
27 sudo -u postgres initdb -D /etc/${PN}/ 27 sudo -u postgres initdb -D /etc/${PN}/
28 sleep 2 28 sleep 2
29 echo "listen_addresses = '*'" >> /etc/${PN}/postgresql.conf
30 echo "host all all ${CONTROLLER_IP}/32 trust" >> /etc/${PN}/pg_hba.conf
31 echo "host all all ${COMPUTE_IP}/32 trust" >> /etc/${PN}/pg_hba.conf
32 sleep 2
29 /etc/init.d/postgresql start 33 /etc/init.d/postgresql start
30 sleep 5 34 sleep 5
31 35