|
23 | 23 | # be installed. You may specify an explicit version |
24 | 24 | # number, 'present', or 'latest'. Defaults to |
25 | 25 | # '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`). |
26 | 30 | # |
27 | 31 | # Actions: |
28 | 32 | # - Configures the puppet master to use puppetdb. |
|
46 | 50 | $puppet_confdir = '/etc/puppet', |
47 | 51 | $puppet_conf = '/etc/puppet/puppet.conf', |
48 | 52 | $puppetdb_version = $puppetdb::params::puppetdb_version, |
| 53 | + $restart_puppet = true, |
49 | 54 | ) inherits puppetdb::params { |
50 | 55 |
|
51 | 56 | package { 'puppetdb-terminus': |
|
66 | 71 | # this validator." |
67 | 72 | Service<|title == 'puppetdb'|> -> Puppetdb_conn_validator['puppetdb_conn'] |
68 | 73 |
|
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 | | - |
77 | 74 | # Conditionally manage the `routes.yaml` file. Restart the puppet service |
78 | 75 | # if changes are made. |
79 | 76 | if ($manage_routes) { |
80 | 77 | class { 'puppetdb::master::routes': |
81 | 78 | puppet_confdir => $puppet_confdir, |
82 | 79 | require => Puppetdb_conn_validator['puppetdb_conn'], |
83 | | - notify => Service[$puppetdb::params::puppet_service_name], |
84 | 80 | } |
85 | 81 | } |
86 | 82 |
|
|
101 | 97 | port => $puppetdb_port, |
102 | 98 | puppet_confdir => $puppet_confdir, |
103 | 99 | require => Puppetdb_conn_validator['puppetdb_conn'], |
104 | | - notify => Service[$puppetdb::params::puppet_service_name], |
105 | 100 | } |
| 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 | + |
106 | 115 | } |
0 commit comments