Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,7 @@ Upgrading
Significant parameter changes are listed below:

* The PuppetDB module now supports PuppetDB 3.0.0 by default
* The PuppetDB module now manages Postgres repos by default. To turn this behavior off, set `manage_package_repo` to false.
* If you want to use 5.x of the module with PuppetDB 2.x, you'll need to use the new `puppetdb::globals` class to set the version of PuppetDB you're using explicitly. The ability to configure the version has been therefore moved out of the `puppetdb` and `puppetdb::server` classes.
For example if your config looked like this before:
~~~ruby
Expand Down Expand Up @@ -598,11 +599,11 @@ The URL to use for testing if the PuppetDB instance is running. Defaults to `/pd

####`manage_package_repo`

if this is true, the official postgres.org repo will be added and postgres won't be installed from the regular repository.
If this is true, the official postgres.org repo will be added and postgres won't be installed from the regular repository. This setting defaults to `true`.

####`postgres_version`

if the postgres.org repo is installed, you can install several versions of postgres, this currently defaults to 9.4 which is the latest stable version.
If the postgres.org repo is installed, you can install several versions of postgres. This currently defaults to 9.4 which is the latest stable version.

Implementation
---------------
Expand Down
8 changes: 3 additions & 5 deletions manifests/database/postgresql.pp
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,9 @@
) inherits puppetdb::params {

if $manage_server {
if $manage_package_repo {
class { '::postgresql::globals':
manage_package_repo => true,
version => $postgres_version,
}
class { '::postgresql::globals':
manage_package_repo => $manage_package_repo,
version => $postgres_version,
}
# get the pg server up and running
class { '::postgresql::server':
Expand Down
4 changes: 2 additions & 2 deletions manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -127,12 +127,12 @@
}

if ($database == 'postgres') {

$database_before = str2bool($database_validate) ? {
false => Class['::puppetdb::server'],
default => [Class['::puppetdb::server'], Class['::puppetdb::server::validate_db']],
}

class { '::puppetdb::database::postgresql':
listen_addresses => $database_listen_address,
database_name => $database_name,
Expand Down
2 changes: 1 addition & 1 deletion manifests/params.pp
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
$puppetdb_version = $puppetdb::globals::version
$database = $puppetdb::globals::database
$manage_dbserver = true
$manage_pg_repo = false
$manage_pg_repo = true
$postgres_version = '9.4'

# The remaining database settings are not used for an embedded database
Expand Down
2 changes: 2 additions & 0 deletions spec/unit/classes/init_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@
:operatingsystemrelease => '6.0',
:kernel => 'Linux',
:concat_basedir => '/var/lib/puppet/concat',
:lsbdistid => 'Debian',
:lsbdistcodename => 'foo',
:id => 'root',
:path => '/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin',
}
Expand Down
2 changes: 2 additions & 0 deletions spec/unit/classes/master/config_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
:operatingsystem => 'Debian',
:operatingsystemrelease => '6.0',
:kernel => 'Linux',
:lsbdistid => 'Debian',
:lsbdistcodename => 'foo',
:concat_basedir => '/var/lib/puppet/concat',
:id => 'root',
:path => '/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin',
Expand Down
2 changes: 2 additions & 0 deletions spec/unit/classes/master/puppetdb_conf_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
:osfamily => 'Debian',
:operatingsystem => 'Debian',
:operatingsystemrelease => '6.0',
:lsbdistid => 'Debian',
:lsbdistcodename => 'foo',
:kernel => 'Linux',
:concat_basedir => '/var/lib/puppet/concat',
:id => 'root',
Expand Down