Skip to content

Commit 5f48dab

Browse files
committed
Merge pull request #9 from cprice-puppet/feature/master/parameter-for-restart-puppet
Add a parameter for restarting puppet master
2 parents af50c42 + 2941dbd commit 5f48dab

3 files changed

Lines changed: 26 additions & 11 deletions

File tree

CHANGELOG

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
2012-09-23 - Chris Price <chris@puppetlabs.com>
2+
* 1.0.3 release
3+
4+
2012-09-23 - Chris Price <chris@puppetlabs.com>
5+
* Add a parameter for restarting puppet master (179b337)
6+
17
2012-09-21 - Chris Price <chris@puppetlabs.com>
28
* 1.0.2 release
39

Modulefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name 'puppetlabs-puppetdb'
2-
version '1.0.2'
2+
version '1.0.3'
33
source 'git://github.com/puppetlabs-puppet/puppetlabs-puppetdb.git'
44
author 'Puppet Labs'
55
description 'PuppetDB resource types'

manifests/master/config.pp

Lines changed: 19 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,10 @@
2323
# be installed. You may specify an explicit version
2424
# number, 'present', or 'latest'. Defaults to
2525
# 'present'.
26+
# ['restart_puppet'] - If true, the module will restart the puppet master when
27+
# necessary. The default is 'true'. If set to 'false',
28+
# you must restart the service manually in order to pick
29+
# up changes to the config files (other than `puppet.conf`).
2630
#
2731
# Actions:
2832
# - Configures the puppet master to use puppetdb.
@@ -46,6 +50,7 @@
4650
$puppet_confdir = '/etc/puppet',
4751
$puppet_conf = '/etc/puppet/puppet.conf',
4852
$puppetdb_version = $puppetdb::params::puppetdb_version,
53+
$restart_puppet = true,
4954
) inherits puppetdb::params {
5055

5156
package { 'puppetdb-terminus':
@@ -66,21 +71,12 @@
6671
# this validator."
6772
Service<|title == 'puppetdb'|> -> Puppetdb_conn_validator['puppetdb_conn']
6873

69-
# We will need to restart the puppet master service if certain config
70-
# files are changed, so here we make sure it's in the catalog.
71-
if ! defined(Service[$puppetdb::params::puppet_service_name]) {
72-
service { $puppetdb::params::puppet_service_name:
73-
ensure => running,
74-
}
75-
}
76-
7774
# Conditionally manage the `routes.yaml` file. Restart the puppet service
7875
# if changes are made.
7976
if ($manage_routes) {
8077
class { 'puppetdb::master::routes':
8178
puppet_confdir => $puppet_confdir,
8279
require => Puppetdb_conn_validator['puppetdb_conn'],
83-
notify => Service[$puppetdb::params::puppet_service_name],
8480
}
8581
}
8682

@@ -101,6 +97,19 @@
10197
port => $puppetdb_port,
10298
puppet_confdir => $puppet_confdir,
10399
require => Puppetdb_conn_validator['puppetdb_conn'],
104-
notify => Service[$puppetdb::params::puppet_service_name],
105100
}
101+
102+
if ($restart_puppet) {
103+
# We will need to restart the puppet master service if certain config
104+
# files are changed, so here we make sure it's in the catalog.
105+
if ! defined(Service[$puppetdb::params::puppet_service_name]) {
106+
service { $puppetdb::params::puppet_service_name:
107+
ensure => running,
108+
}
109+
}
110+
111+
Class['puppetdb::master::puppetdb_conf'] ~> Service[$puppetdb::params::puppet_service_name]
112+
Class['puppetdb::master::routes'] ~> Service[$puppetdb::params::puppet_service_name]
113+
}
114+
106115
}

0 commit comments

Comments
 (0)