Merge pull request #197 from ajroetker/ticket/pdb-1657/master/manage_pg_repos_by_default
(PDB-1657) Manage Postgres repos by default
This commit is contained in:
commit
a078002454
7 changed files with 15 additions and 10 deletions
|
@ -144,6 +144,7 @@ Upgrading
|
||||||
Significant parameter changes are listed below:
|
Significant parameter changes are listed below:
|
||||||
|
|
||||||
* The PuppetDB module now supports PuppetDB 3.0.0 by default
|
* 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.
|
* 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:
|
For example if your config looked like this before:
|
||||||
~~~ruby
|
~~~ruby
|
||||||
|
@ -598,11 +599,11 @@ The URL to use for testing if the PuppetDB instance is running. Defaults to `/pd
|
||||||
|
|
||||||
####`manage_package_repo`
|
####`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`
|
####`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
|
Implementation
|
||||||
---------------
|
---------------
|
||||||
|
|
|
@ -11,11 +11,9 @@ class puppetdb::database::postgresql(
|
||||||
) inherits puppetdb::params {
|
) inherits puppetdb::params {
|
||||||
|
|
||||||
if $manage_server {
|
if $manage_server {
|
||||||
if $manage_package_repo {
|
class { '::postgresql::globals':
|
||||||
class { '::postgresql::globals':
|
manage_package_repo => $manage_package_repo,
|
||||||
manage_package_repo => true,
|
version => $postgres_version,
|
||||||
version => $postgres_version,
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
# get the pg server up and running
|
# get the pg server up and running
|
||||||
class { '::postgresql::server':
|
class { '::postgresql::server':
|
||||||
|
|
|
@ -127,12 +127,12 @@ class puppetdb (
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($database == 'postgres') {
|
if ($database == 'postgres') {
|
||||||
|
|
||||||
$database_before = str2bool($database_validate) ? {
|
$database_before = str2bool($database_validate) ? {
|
||||||
false => Class['::puppetdb::server'],
|
false => Class['::puppetdb::server'],
|
||||||
default => [Class['::puppetdb::server'], Class['::puppetdb::server::validate_db']],
|
default => [Class['::puppetdb::server'], Class['::puppetdb::server::validate_db']],
|
||||||
}
|
}
|
||||||
|
|
||||||
class { '::puppetdb::database::postgresql':
|
class { '::puppetdb::database::postgresql':
|
||||||
listen_addresses => $database_listen_address,
|
listen_addresses => $database_listen_address,
|
||||||
database_name => $database_name,
|
database_name => $database_name,
|
||||||
|
|
|
@ -15,7 +15,7 @@ class puppetdb::params inherits puppetdb::globals {
|
||||||
$puppetdb_version = $puppetdb::globals::version
|
$puppetdb_version = $puppetdb::globals::version
|
||||||
$database = $puppetdb::globals::database
|
$database = $puppetdb::globals::database
|
||||||
$manage_dbserver = true
|
$manage_dbserver = true
|
||||||
$manage_pg_repo = false
|
$manage_pg_repo = true
|
||||||
$postgres_version = '9.4'
|
$postgres_version = '9.4'
|
||||||
|
|
||||||
# The remaining database settings are not used for an embedded database
|
# The remaining database settings are not used for an embedded database
|
||||||
|
|
|
@ -11,6 +11,8 @@ describe 'puppetdb', :type => :class do
|
||||||
:operatingsystemrelease => '6.0',
|
:operatingsystemrelease => '6.0',
|
||||||
:kernel => 'Linux',
|
:kernel => 'Linux',
|
||||||
:concat_basedir => '/var/lib/puppet/concat',
|
:concat_basedir => '/var/lib/puppet/concat',
|
||||||
|
:lsbdistid => 'Debian',
|
||||||
|
:lsbdistcodename => 'foo',
|
||||||
:id => 'root',
|
:id => 'root',
|
||||||
:path => '/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin',
|
: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',
|
:operatingsystem => 'Debian',
|
||||||
:operatingsystemrelease => '6.0',
|
:operatingsystemrelease => '6.0',
|
||||||
:kernel => 'Linux',
|
:kernel => 'Linux',
|
||||||
|
:lsbdistid => 'Debian',
|
||||||
|
:lsbdistcodename => 'foo',
|
||||||
:concat_basedir => '/var/lib/puppet/concat',
|
:concat_basedir => '/var/lib/puppet/concat',
|
||||||
:id => 'root',
|
:id => 'root',
|
||||||
:path => '/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin',
|
: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',
|
:osfamily => 'Debian',
|
||||||
:operatingsystem => 'Debian',
|
:operatingsystem => 'Debian',
|
||||||
:operatingsystemrelease => '6.0',
|
:operatingsystemrelease => '6.0',
|
||||||
|
:lsbdistid => 'Debian',
|
||||||
|
:lsbdistcodename => 'foo',
|
||||||
:kernel => 'Linux',
|
:kernel => 'Linux',
|
||||||
:concat_basedir => '/var/lib/puppet/concat',
|
:concat_basedir => '/var/lib/puppet/concat',
|
||||||
:id => 'root',
|
:id => 'root',
|
||||||
|
|
Loading…
Reference in a new issue