Add support for JDBC connector.
Modify params.pp to abstract the package name for the postgresql JDBC connector and add Class['postgresql::java']. Also update the README.md to mention the availability of this class.
This commit is contained in:
parent
aa1cd44c25
commit
556ab32b73
3 changed files with 38 additions and 0 deletions
|
@ -150,6 +150,15 @@ The name of the postgresql client package.
|
|||
####`package_ensure`
|
||||
The ensure parameter passed on to postgresql client package resource.
|
||||
|
||||
###postgresql::java
|
||||
This class installs postgresql bindings for Java (JDBC). Alter the following parameters if you have a custom version you would like to install (Note: don't forget to make sure to add any necessary yum or apt repositories if specifying a custom version):
|
||||
|
||||
####`package_name`
|
||||
The name of the postgresql java package.
|
||||
|
||||
####`package_ensure`
|
||||
The ensure parameter passed on to postgresql java package resource.
|
||||
|
||||
### Custom Functions
|
||||
|
||||
If you need to generate a postgres encrypted password, use `postgresql_password`. You can call it from your production manifests if you don’t mind them containing the clear text versions of your passwords, or you can call it from the command line and then copy and paste the encrypted password into your manifest:
|
||||
|
|
26
manifests/java.pp
Normal file
26
manifests/java.pp
Normal file
|
@ -0,0 +1,26 @@
|
|||
# Class: postgresql::java
|
||||
#
|
||||
# This class installs the postgresql jdbc connector.
|
||||
#
|
||||
# Parameters:
|
||||
# [*java_package_name*] - The name of the postgresql java package.
|
||||
#
|
||||
# Actions:
|
||||
#
|
||||
# Requires:
|
||||
#
|
||||
# Sample Usage:
|
||||
#
|
||||
# class { 'postgresql::java': }
|
||||
#
|
||||
class postgresql::java (
|
||||
$package_name = $postgresql::params::java_package_name,
|
||||
$package_ensure = 'present'
|
||||
) inherits postgresql::params {
|
||||
|
||||
package { 'postgresql-jdbc':
|
||||
ensure => $package_ensure,
|
||||
name => $package_name,
|
||||
}
|
||||
|
||||
}
|
|
@ -101,6 +101,7 @@ class postgresql::params(
|
|||
$client_package_name = 'postgresql'
|
||||
$server_package_name = 'postgresql-server'
|
||||
$devel_package_name = 'postgresql-devel'
|
||||
$java_package_name = 'postgresql-jdbc'
|
||||
$service_name = 'postgresql'
|
||||
$bindir = '/usr/bin'
|
||||
$datadir = '/var/lib/pgsql/data'
|
||||
|
@ -111,6 +112,7 @@ class postgresql::params(
|
|||
$client_package_name = "postgresql${package_version}"
|
||||
$server_package_name = "postgresql${package_version}-server"
|
||||
$devel_package_name = "postgresql${package_version}-devel"
|
||||
$java_package_name = "postgresql${package_version}-jdbc"
|
||||
$service_name = "postgresql-${version}"
|
||||
$bindir = "/usr/pgsql-${version}/bin"
|
||||
$datadir = "/var/lib/pgsql/${version}/data"
|
||||
|
@ -145,6 +147,7 @@ class postgresql::params(
|
|||
$client_package_name = "postgresql-client-${version}"
|
||||
$server_package_name = "postgresql-${version}"
|
||||
$devel_package_name = 'libpq-dev'
|
||||
$java_package_name = 'libpostgresql-jdbc-java'
|
||||
$bindir = "/usr/lib/postgresql/${version}/bin"
|
||||
$datadir = "/var/lib/postgresql/${version}/main"
|
||||
$confdir = "/etc/postgresql/${version}/main"
|
||||
|
|
Loading…
Reference in a new issue