|
8 | 8 | # ['puppet_agent_service'] - The service the puppet agent runs under
|
9 | 9 | # ['puppet_agent_package'] - The name of the package providing the puppet agent
|
10 | 10 | # ['version'] - The version of the puppet agent to install
|
11 |
| -# ['puppet_run_style'] - The run style of the agent either cron or service |
| 11 | +# ['puppet_run_style'] - The run style of the agent either 'service', 'cron', 'external' or 'manual' |
12 | 12 | # ['puppet_run_interval'] - The run interval of the puppet agent in minutes, default is 30 minutes
|
13 | 13 | # ['user_id'] - The userid of the puppet user
|
14 | 14 | # ['group_id'] - The groupid of the puppet group
|
|
85 | 85 | $startonboot = 'no'
|
86 | 86 | }
|
87 | 87 |
|
88 |
| - if ($::osfamily == 'Debian') or ($::osfamily == 'Redhat') { |
| 88 | + if ($::osfamily == 'Debian' and $puppet_run_style != 'manual') or ($::osfamily == 'Redhat') { |
89 | 89 | file { $puppet::params::puppet_defaults:
|
90 | 90 | mode => '0644',
|
91 | 91 | owner => 'root',
|
|
101 | 101 | require => Package[$puppet_agent_package],
|
102 | 102 | owner => $::puppet::params::puppet_user,
|
103 | 103 | group => $::puppet::params::puppet_group,
|
104 |
| - notify => Service[$puppet_agent_service], |
105 | 104 | mode => '0655',
|
106 | 105 | }
|
107 | 106 | }
|
|
135 | 134 | $service_ensure = 'stopped'
|
136 | 135 | $service_enable = false
|
137 | 136 | }
|
| 137 | + # Do not manage the Puppet service and don't touch Debian's defaults file. |
| 138 | + manual: { |
| 139 | + $service_ensure = undef |
| 140 | + $service_enable = undef |
| 141 | + } |
138 | 142 | default: {
|
139 | 143 | err 'Unsupported puppet run style in Class[\'puppet::agent\']'
|
140 | 144 | }
|
141 | 145 | }
|
142 | 146 |
|
143 |
| - service { $puppet_agent_service: |
144 |
| - ensure => $service_ensure, |
145 |
| - enable => $service_enable, |
146 |
| - hasstatus => true, |
147 |
| - hasrestart => true, |
148 |
| - subscribe => File [$::puppet::params::puppet_conf], |
149 |
| - require => Package[$puppet_agent_package], |
| 147 | + if $puppet_run_style != 'manual' { |
| 148 | + service { $puppet_agent_service: |
| 149 | + ensure => $service_ensure, |
| 150 | + enable => $service_enable, |
| 151 | + hasstatus => true, |
| 152 | + hasrestart => true, |
| 153 | + subscribe => [File[$::puppet::params::puppet_conf], File[$::puppet::params::confdir]], |
| 154 | + require => Package[$puppet_agent_package], |
| 155 | + } |
150 | 156 | }
|
151 | 157 |
|
152 | 158 | if ! defined(File[$::puppet::params::puppet_conf]) {
|
|
156 | 162 | require => File[$::puppet::params::confdir],
|
157 | 163 | owner => $::puppet::params::puppet_user,
|
158 | 164 | group => $::puppet::params::puppet_group,
|
159 |
| - notify => Service[$puppet_agent_service], |
160 | 165 | }
|
161 | 166 | }
|
162 | 167 | else {
|
|
0 commit comments