From 28ab90eb48ea8ca6fbb733a1af8f1aa11ea9ec11 Mon Sep 17 00:00:00 2001 From: Christian Kaenzig Date: Thu, 5 Apr 2012 17:20:05 +0200 Subject: [PATCH] postgresql: add support for v9.1 on ubuntu precise --- manifests/init.pp | 1 + manifests/ubuntu/v9-1.pp | 40 ++++++++++++++++++++++++++++++++++++++++ manifests/v9-1.pp | 6 ++++++ 3 files changed, 47 insertions(+) create mode 100644 manifests/ubuntu/v9-1.pp diff --git a/manifests/init.pp b/manifests/init.pp index 2703572..93eb34f 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -10,6 +10,7 @@ Ubuntu: { case $lsbdistcodename { lucid : { include postgresql::debian::v8-4 } + precise: { include postgresql::ubuntu::v9-1 } default: { fail "postgresql not available for ${operatingsystem}/${lsbdistcodename}"} } } diff --git a/manifests/ubuntu/v9-1.pp b/manifests/ubuntu/v9-1.pp new file mode 100644 index 0000000..502b1c4 --- /dev/null +++ b/manifests/ubuntu/v9-1.pp @@ -0,0 +1,40 @@ +/* + +==Class: postgresql::ubuntu::v9-1 + +Parameters: + $postgresql_data_dir: + set the data directory path, which is used to store all the databases + +*/ +class postgresql::ubuntu::v9-1 { + + $version = "9.1" + + case $lsbdistcodename { + 'precise': { + + include postgresql::debian::base + + service {"postgresql": + ensure => running, + enable => true, + hasstatus => true, + start => "/etc/init.d/postgresql start ${version}", + status => "/etc/init.d/postgresql status ${version}", + stop => "/etc/init.d/postgresql stop ${version}", + restart => "/etc/init.d/postgresql restart ${version}", + require => Package["postgresql-common"], + } + + exec { "reload postgresql ${version}": + refreshonly => true, + command => "/etc/init.d/postgresql reload ${version}", + } + } + + default: { + fail "${name} not available for ${operatingsystem}/${lsbdistcodename}" + } + } +} diff --git a/manifests/v9-1.pp b/manifests/v9-1.pp index 561c4e2..81b140a 100644 --- a/manifests/v9-1.pp +++ b/manifests/v9-1.pp @@ -6,6 +6,12 @@ default: { fail "postgresql 9.1 not available for ${operatingsystem}/${lsbdistcodename}"} } } + Ubuntu: { + case $lsbdistcodename { + lucid : { include postgresql::debian::v9-1 } + default: { fail "postgresql 9.1 not available for ${operatingsystem}/${lsbdistcodename}"} + } + } default: { notice "Unsupported operatingsystem ${operatingsystem}" } } }