newer pg module
[mirror/dsa-puppet.git] / 3rdparty / modules / postgresql / manifests / client.pp
index fb82509..7e6da1c 100644 (file)
@@ -1,28 +1,25 @@
-# Class: postgresql::client
-#
-#   This class installs postgresql client software.
-#
-#   *Note* don't forget to make sure to add any necessary yum or apt
-#   repositories if specifying a custom version.
-#
-# Parameters:
-#   [*package_name*]  - The name of the postgresql client package.
-#   [*ensure*] - the ensure parameter passed to the postgresql client package resource
-# Actions:
-#
-# Requires:
-#
-# Sample Usage:
-#
+# Install client cli tool. See README.md for more details.
 class postgresql::client (
-  $package_name   = $postgresql::params::client_package_name,
-  $package_ensure = 'present'
+  Enum['file', 'absent'] $file_ensure        = 'file',
+  Stdlib::Absolutepath $validcon_script_path = $postgresql::params::validcon_script_path,
+  String[1] $package_name                    = $postgresql::params::client_package_name,
+  String[1] $package_ensure                  = 'present'
 ) inherits postgresql::params {
 
-  package { 'postgresql-client':
-    ensure  => $package_ensure,
-    name    => $package_name,
-    tag     => 'postgresql',
+  if $package_name != 'UNSET' {
+    package { 'postgresql-client':
+      ensure => $package_ensure,
+      name   => $package_name,
+      tag    => 'postgresql',
+    }
+  }
+
+  file { $validcon_script_path:
+    ensure => $file_ensure,
+    source => 'puppet:///modules/postgresql/validate_postgresql_connection.sh',
+    owner  => 0,
+    group  => 0,
+    mode   => '0755',
   }
 
 }