Skip to content

Commit dbc2242

Browse files
author
Daniel Schaaff
committed
itj-3020
add launchd creatin to puppet::agent
1 parent d5e48f3 commit dbc2242

File tree

2 files changed

+43
-0
lines changed

2 files changed

+43
-0
lines changed

manifests/agent.pp

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,10 +147,13 @@
147147

148148
if $puppet_run_style == 'service' {
149149
$startonboot = 'yes'
150+
$daemonize = true
150151
}
151152
else {
152153
$startonboot = 'no'
154+
$daemonize = false
153155
}
156+
154157

155158
if ($::osfamily == 'Debian' and $puppet_run_style != 'manual') or ($::osfamily == 'Redhat') {
156159
file { $puppet::params::puppet_defaults:
@@ -161,6 +164,14 @@
161164
content => template("puppet/${puppet::params::puppet_defaults}.erb"),
162165
}
163166
}
167+
elsif $::osfamily == 'Darwin' {
168+
file {'/Library/LaunchDaemons/com.puppetlabs.puppet.plist':
169+
mode => '0644',
170+
owner => 'root',
171+
group => 'wheel',
172+
content => template('puppet/launchd/com.puppetlabs.puppet.plist.erb'),
173+
}
174+
}
164175

165176
if ! defined(File[$::puppet::params::confdir]) {
166177
file { $::puppet::params::confdir:
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3+
<plist version="1.0">
4+
<dict>
5+
<key>Disabled</key>
6+
<true/>
7+
<key>Label</key>
8+
<string>com.puppetlabs.puppet</string>
9+
<key>OnDemand</key>
10+
<false/>
11+
<key>ProgramArguments</key>
12+
<array>
13+
<string>/usr/bin/puppet</string>
14+
<string>agent</string>
15+
<%- if @puppet_run_style == "service" -%>
16+
<string>daemonize</string>
17+
<%- else -%>
18+
<string>no-daemonize</string>
19+
<%- end -%>
20+
<string>--logdest</string>
21+
<string>syslog</string>
22+
<string>--color</string>
23+
<string>false</string>
24+
</array>
25+
<key>RunAtLoad</key>
26+
<true/>
27+
<key>ServiceDescription</key>
28+
<string>Puppet agent service</string>
29+
<key>ServiceIPC</key>
30+
<false/>
31+
</dict>
32+
</plist>

0 commit comments

Comments
 (0)