|
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
|
|
83 | 83 | $startonboot = 'no'
|
84 | 84 | }
|
85 | 85 |
|
86 |
| - if ($::osfamily == 'Debian') or ($::osfamily == 'Redhat') { |
| 86 | + if ($::osfamily == 'Debian' and $puppet_run_style != 'manual') or ($::osfamily == 'Redhat') { |
87 | 87 | file { $puppet::params::puppet_defaults:
|
88 | 88 | mode => '0644',
|
89 | 89 | owner => 'root',
|
|
132 | 132 | $service_ensure = 'stopped'
|
133 | 133 | $service_enable = false
|
134 | 134 | }
|
| 135 | + # Do not manage the Puppet service and don't touch Debian's defaults file. |
| 136 | + manual: { |
| 137 | + $service_ensure = undef |
| 138 | + $service_enable = undef |
| 139 | + } |
135 | 140 | default: {
|
136 | 141 | err 'Unsupported puppet run style in Class[\'puppet::agent\']'
|
137 | 142 | }
|
138 | 143 | }
|
139 | 144 |
|
140 |
| - service { $puppet_agent_service: |
141 |
| - ensure => $service_ensure, |
142 |
| - enable => $service_enable, |
143 |
| - hasstatus => true, |
144 |
| - hasrestart => true, |
145 |
| - subscribe => [File[$::puppet::params::puppet_conf], File[$::puppet::params::confdir]], |
146 |
| - require => Package[$puppet_agent_package], |
| 145 | + if $puppet_run_style != 'manual' { |
| 146 | + service { $puppet_agent_service: |
| 147 | + ensure => $service_ensure, |
| 148 | + enable => $service_enable, |
| 149 | + hasstatus => true, |
| 150 | + hasrestart => true, |
| 151 | + subscribe => [File[$::puppet::params::puppet_conf], File[$::puppet::params::confdir]], |
| 152 | + require => Package[$puppet_agent_package], |
| 153 | + } |
147 | 154 | }
|
148 | 155 |
|
149 | 156 | if ! defined(File[$::puppet::params::puppet_conf]) {
|
|
0 commit comments