(PDB-1657) Manage Postgres repos by default
This commit moves to managing the Postgres repos by default. The reason for this is so that the `puppetdb` class will "just work" by default on most systems, because PostgreSQL 9.4 is not installed on 6/7 of the distros we support we need to manage the repos so we can install the latest version.
This commit is contained in:
parent
72dd45863a
commit
8eb9f67669
7 changed files with 15 additions and 10 deletions
|
@ -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
|
||||
|
@ -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
|
||||
---------------
|
||||
|
|
|
@ -11,11 +11,9 @@ class puppetdb::database::postgresql(
|
|||
) 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':
|
||||
|
|
|
@ -127,12 +127,12 @@ class puppetdb (
|
|||
}
|
||||
|
||||
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,
|
||||
|
|
|
@ -15,7 +15,7 @@ class puppetdb::params inherits puppetdb::globals {
|
|||
$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
|
||||
|
|
|
@ -11,6 +11,8 @@ describe 'puppetdb', :type => :class do
|
|||
: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',
|
||||
}
|
||||
|
|
|
@ -9,6 +9,8 @@ describe 'puppetdb::master::config', :type => :class do
|
|||
: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',
|
||||
|
|
|
@ -8,6 +8,8 @@ describe 'puppetdb::master::puppetdb_conf', :type => :class do
|
|||
:osfamily => 'Debian',
|
||||
:operatingsystem => 'Debian',
|
||||
:operatingsystemrelease => '6.0',
|
||||
:lsbdistid => 'Debian',
|
||||
:lsbdistcodename => 'foo',
|
||||
:kernel => 'Linux',
|
||||
:concat_basedir => '/var/lib/puppet/concat',
|
||||
:id => 'root',
|
||||
|
|
Loading…
Reference in a new issue