diff options
author | Michael Scherer <misc@mageia.org> | 2012-01-13 22:26:53 +0000 |
---|---|---|
committer | Michael Scherer <misc@mageia.org> | 2012-01-13 22:26:53 +0000 |
commit | c973ccd87c56a318dd91b4c2a7bcbdce3580395f (patch) | |
tree | 3b277fd282d9fcba36791b4015d966ae1428d986 /modules/postgresql/manifests/init.pp | |
parent | e32bd068c0bf3759dd449f60e6e30196d86fa2a0 (diff) | |
download | puppet-c973ccd87c56a318dd91b4c2a7bcbdce3580395f.tar puppet-c973ccd87c56a318dd91b4c2a7bcbdce3580395f.tar.gz puppet-c973ccd87c56a318dd91b4c2a7bcbdce3580395f.tar.bz2 puppet-c973ccd87c56a318dd91b4c2a7bcbdce3580395f.tar.xz puppet-c973ccd87c56a318dd91b4c2a7bcbdce3580395f.zip |
small refactoring and cleanup of postgresql module
Diffstat (limited to 'modules/postgresql/manifests/init.pp')
-rw-r--r-- | modules/postgresql/manifests/init.pp | 53 |
1 files changed, 17 insertions, 36 deletions
diff --git a/modules/postgresql/manifests/init.pp b/modules/postgresql/manifests/init.pp index 4bd35c98..4e71db23 100644 --- a/modules/postgresql/manifests/init.pp +++ b/modules/postgresql/manifests/init.pp @@ -8,12 +8,10 @@ class postgresql { # 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'], } @@ -25,9 +23,6 @@ class postgresql { exec { "service postgresql reload": refreshonly => true, - subscribe => [ File["postgresql.conf"], - File["pg_ident.conf"], - File["pg_hba.conf"] ] } openssl::self_signed_splitted_cert { "pgsql.$domain": @@ -40,45 +35,31 @@ class postgresql { 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"], + + define config($content) { + file { "$name": + owner => postgres, + group => postgres, + mode => 600, + content => template("postgresql/postgresql.conf"), + require => Package["postgresql-server"], + notify => Exec['service postgresql reload'], + } } - + + $db = list_exported_ressources('Postgresql::Db_and_user') $forum_lang = list_exported_ressources('Phpbb::Locale_db') - 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"], + + config { + "$pgsql_data/pg_hba.conf": content => template("postgresql/pg_hba.conf"); + "$pgsql_data/pg_ident.conf": content => template("postgresql/pg_ident.conf"); + "$pgsql_data/postgresql.conf": content => template("postgresql/postgresql.conf"); } - 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"], - } } define tagged() { |