From 9833b3c703ad0ed842540236b113c78d4971957f Mon Sep 17 00:00:00 2001 From: Clark Boylan Date: Thu, 6 Feb 2014 11:08:46 -0800 Subject: [PATCH] Make postgres work on Jenkins slaves again. A few upstream puppetlabs postgres module bugs need to be worked around in order to have postgres servers installed on our slaves. Need to create the postgres user and group before the upstream module runs and provide hostnames to the postgres server config instead of ip addresses. Change-Id: I68cea595d0cd6ad9b2155166ff473d1375e9b7ac --- modules/jenkins/manifests/slave.pp | 24 ++++++++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) diff --git a/modules/jenkins/manifests/slave.pp b/modules/jenkins/manifests/slave.pp index 478cc75e03..596952dc6c 100644 --- a/modules/jenkins/manifests/slave.pp +++ b/modules/jenkins/manifests/slave.pp @@ -270,11 +270,31 @@ class jenkins::slave( require => Database_user['openstack_citest@localhost'], } + # The puppetlabs postgres module does not manage the postgres user + # and group for us. Create them here to ensure concat can create + # dirs and files owned by this user and group. + user { 'postgres': + ensure => present, + gid => 'postgres', + system => true, + require => Group['postgres'], + } + + group { 'postgres': + ensure => present, + system => true, + } + class { 'postgresql::server': postgres_password => 'insecure_slave', manage_firewall => false, - listen_addresses => '127.0.0.1', - require => Class['postgresql::params'], + # The puppetlabs postgres module incorrectly quotes ip addresses + # in the postgres server config. Use localhost instead. + listen_addresses => ['localhost'], + require => [ + User['postgres'], + Class['postgresql::params'], + ], } class { 'postgresql::lib::devel':