diff options
author | Michael Scherer <misc@mageia.org> | 2010-12-07 02:40:24 +0000 |
---|---|---|
committer | Michael Scherer <misc@mageia.org> | 2010-12-07 02:40:24 +0000 |
commit | dc86f27c498f48398591517b449d94e5405f7b32 (patch) | |
tree | 52061d2ffe4792d46eea8b0e4f419330f021e4b4 /modules/postgresql/manifests/init.pp | |
parent | 327196eaee37984b6ea264efca7158b2adf5971a (diff) | |
download | puppet-dc86f27c498f48398591517b449d94e5405f7b32.tar puppet-dc86f27c498f48398591517b449d94e5405f7b32.tar.gz puppet-dc86f27c498f48398591517b449d94e5405f7b32.tar.bz2 puppet-dc86f27c498f48398591517b449d94e5405f7b32.tar.xz puppet-dc86f27c498f48398591517b449d94e5405f7b32.zip |
- move the postgresql server bits to a subclass
Diffstat (limited to 'modules/postgresql/manifests/init.pp')
-rw-r--r-- | modules/postgresql/manifests/init.pp | 130 |
1 files changed, 66 insertions, 64 deletions
diff --git a/modules/postgresql/manifests/init.pp b/modules/postgresql/manifests/init.pp index 6765c7e5..1c1fa775 100644 --- a/modules/postgresql/manifests/init.pp +++ b/modules/postgresql/manifests/init.pp @@ -1,72 +1,74 @@ class postgresql { + class server { + $pgsql_data = "/var/lib/pgsql/data/" + $pg_version = '9.0' - $pgsql_data = "/var/lib/pgsql/data/" - $pg_version = '9.0' - - # missing requires is corrected in cooker, - # should be removed - # once the fix is in a stable release - package { "postgresql$pg_version-plpgsql": - alias => "postgresql-plpgsql", - ensure => installed, - } - - package { "postgresql$pg_version-server": - alias => "postgresql-server", - ensure => installed, - require => Package['postgresql-plpgsql'], - } - - service { postgresql: - ensure => running, - subscribe => Package["postgresql-server"], - hasstatus => true, - } - - exec { "service postgresql reload": - refreshonly => true, - subscribe => [ File["postgresql.conf"], - File["pg_ident.conf"], - File["pg_hba.conf"] ] - } - - file { '/etc/pam.d/postgresql': - ensure => present, - owner => root, - group => root, - mode => 644, - content => template("postgresql/pam"), - } - - file { "postgresql.conf": - path => "$pgsql_data/postgresql.conf", - ensure => present, - owner => postgres, - group => postgres, - mode => 600, - content => template("postgresql/postgresql.conf"), - require => Package["postgresql-server"], - } + # missing requires is corrected in cooker, + # should be removed + # once the fix is in a stable release + package { "postgresql$pg_version-plpgsql": + alias => "postgresql-plpgsql", + ensure => installed, + } - file { 'pg_hba.conf': - path => "$pgsql_data/pg_hba.conf", - ensure => present, - owner => postgres, - group => postgres, - mode => 600, - content => template("postgresql/pg_hba.conf"), - require => Package["postgresql-server"], + package { "postgresql$pg_version-server": + alias => "postgresql-server", + ensure => installed, + require => Package['postgresql-plpgsql'], + } + + service { postgresql: + ensure => running, + subscribe => Package["postgresql-server"], + hasstatus => true, + } + + exec { "service postgresql reload": + refreshonly => true, + subscribe => [ File["postgresql.conf"], + File["pg_ident.conf"], + File["pg_hba.conf"] ] + } + + file { '/etc/pam.d/postgresql': + ensure => present, + owner => root, + group => root, + mode => 644, + content => template("postgresql/pam"), + } + + file { "postgresql.conf": + path => "$pgsql_data/postgresql.conf", + ensure => present, + owner => postgres, + group => postgres, + mode => 600, + content => template("postgresql/postgresql.conf"), + require => Package["postgresql-server"], + } + + file { 'pg_hba.conf': + path => "$pgsql_data/pg_hba.conf", + ensure => present, + owner => postgres, + group => postgres, + mode => 600, + content => template("postgresql/pg_hba.conf"), + require => Package["postgresql-server"], + } + + file { 'pg_ident.conf': + path => "$pgsql_data/pg_ident.conf", + ensure => present, + owner => postgres, + group => postgres, + mode => 600, + content => template("postgresql/pg_ident.conf"), + require => Package["postgresql-server"], + } } - file { 'pg_ident.conf': - path => "$pgsql_data/pg_ident.conf", - ensure => present, - owner => postgres, - group => postgres, - mode => 600, - content => template("postgresql/pg_ident.conf"), - require => Package["postgresql-server"], - } # TODO convert it to a regular type ( so we can later change user and so on ) define database($description="", $user="postgres") { |