2013-05-29 17:39:49 +02:00
|
|
|
# Class: pgsql
|
|
|
|
#
|
2015-09-28 17:31:23 +02:00
|
|
|
# This class installs the PostgreSQL server and client software.
|
|
|
|
# Further it configures pg_hba.conf to trust the local icinga user.
|
2013-05-29 17:39:49 +02:00
|
|
|
#
|
|
|
|
# Parameters:
|
|
|
|
#
|
|
|
|
# Actions:
|
|
|
|
#
|
|
|
|
# Requires:
|
|
|
|
#
|
|
|
|
# Sample Usage:
|
|
|
|
#
|
|
|
|
# include pgsql
|
|
|
|
#
|
|
|
|
class pgsql {
|
|
|
|
|
|
|
|
Exec { path => '/sbin:/bin:/usr/bin' }
|
|
|
|
|
2015-09-28 17:31:23 +02:00
|
|
|
package { [ 'postgresql', 'postgresql-server', ]:
|
|
|
|
ensure => latest,
|
2013-05-29 17:39:49 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
exec { 'initdb':
|
|
|
|
command => 'service postgresql initdb',
|
2015-09-28 17:31:23 +02:00
|
|
|
creates => '/var/lib/pgsql/data/pg_xlog',
|
|
|
|
require => Package['postgresql-server'],
|
2013-05-29 17:39:49 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
service { 'postgresql':
|
2015-09-28 17:31:23 +02:00
|
|
|
enable => true,
|
2013-05-29 17:39:49 +02:00
|
|
|
ensure => running,
|
2015-09-28 17:31:23 +02:00
|
|
|
require => [ Package['postgresql-server'], Exec['initdb'], ]
|
2013-05-29 17:39:49 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
file { '/var/lib/pgsql/data/pg_hba.conf':
|
|
|
|
content => template('pgsql/pg_hba.conf.erb'),
|
2015-09-28 17:31:23 +02:00
|
|
|
require => [ Package['postgresql-server'], Exec['initdb'], ],
|
|
|
|
notify => Service['postgresql'],
|
2013-05-29 17:39:49 +02:00
|
|
|
}
|
|
|
|
}
|