Add support for specifying the version of the puppetdb packages

Prior to this commit, all of the puppetdb packages were being
installed with 'ensure=present'.  This commit changes things
so that you can explicitly specify a version if you desire;
the default is still 'present'.
This commit is contained in:
Chris Price 2012-09-18 15:52:10 -07:00
parent 47cef23099
commit aef363a8bb
4 changed files with 24 additions and 6 deletions

View file

@ -20,6 +20,10 @@
# db can be used for very small installations or for
# testing, but is not recommended for use in production
# environments. For more info, see the puppetdb docs.)
# ['puppetdb_version'] - The version of the `puppetdb` package that should
# be installed. You may specify an explicit version
# number, 'present', or 'latest'. Defaults to
# 'present'.
#
# Actions:
# - Creates and manages a puppetdb server and its database server/instance.
@ -34,10 +38,12 @@
# TODO: expose more parameters
class puppetdb(
$database = $puppetdb::params::database,
$database = $puppetdb::params::database,
$puppetdb_version = $puppetdb::params::puppetdb_version,
) inherits puppetdb::params {
class { 'puppetdb::server':
database => $database,
database => $database,
puppetdb_version => $puppetdb_version,
}
if ($database == "postgres") {

View file

@ -19,6 +19,10 @@
# storeconfig settings (defaults to true)
# ['puppet_confdir'] - Puppet's config directory; defaults to /etc/puppet
# ['puppet_conf'] - Puppet's config file; defaults to /etc/puppet/puppet.conf
# ['puppetdb_version'] - The version of the `puppetdb` package that should
# be installed. You may specify an explicit version
# number, 'present', or 'latest'. Defaults to
# 'present'.
#
# Actions:
# - Configures the puppet master to use puppetdb.
@ -42,10 +46,11 @@ class puppetdb::master::config(
$manage_storeconfigs = true,
$puppet_confdir = '/etc/puppet',
$puppet_conf = '/etc/puppet/puppet.conf',
)
{
$puppetdb_version = $puppetdb::params::puppetdb_version,
) inherits puppetdb::params {
package { 'puppetdb-terminus':
ensure => present,
ensure => $puppetdb_version,
}
# Validate the puppetdb connection. If we can't connect to puppetdb then we

View file

@ -26,6 +26,8 @@ class puppetdb::params {
$database_username = 'puppetdb'
$database_password = 'puppetdb'
$puppetdb_version = 'present'
# TODO: figure out a way to make this not platform-specific
$manage_redhat_firewall = true

View file

@ -41,6 +41,10 @@
# (defaults to `puppetdb`; ignored for `embedded` db)
# ['database_name'] - The name of the database instance to connect to.
# (defaults to `puppetdb`; ignored for `embedded` db)
# ['puppetdb_version'] - The version of the `puppetdb` package that should
# be installed. You may specify an explicit version
# number, 'present', or 'latest'. Defaults to
# 'present'.
# ['manage_redhat_firewall'] - boolean indicating whether or not the module
# should open a port in the firewall on redhat-based
# systems. Defaults to `true`. This parameter is
@ -73,13 +77,14 @@ class puppetdb::server(
$database_username = $puppetdb::params::database_username,
$database_password = $puppetdb::params::database_password,
$database_name = $puppetdb::params::database_name,
$puppetdb_version = $puppetdb::params::puppetdb_version,
$manage_redhat_firewall = $puppetdb::params::manage_redhat_firewall,
$confdir = $puppetdb::params::confdir,
$gc_interval = $puppetdb::params::gc_interval,
) inherits puppetdb::params {
package { 'puppetdb':
ensure => present,
ensure => $puppetdb_version,
notify => Service['puppetdb'],
}