puppet can'd find launchd job when using service resource

asked 2016-08-30 17:35:51 -0500

r0b0tAnthony gravatar image

updated 2016-09-01 10:41:01 -0500

Hi,

I am trying to register a service on a mac. I have had puppet create the plist file in /Library/LaunchDaemons. I am running puppet 3.8.4

Here is my puppet code:

file { '/Library/LaunchDaemons/com.elastic.filebeat.plist':
    ensure  => present,
    mode    => "0644",
    owner   => "root",
    group   => "wheel",
    content => template("${module_name}/com.elastic.filebeat.plist.erb"),
    require => [Exec["untar ${filename}"]],
  }

  service{ 'com.elastic.filebeat':
    ensure  => running,
    enable  => true,
    path    => '/Library/LaunchDaemons',
    require => File['/Library/LaunchDaemons/com.elastic.filebeat.plist'],
  }

Here is the plist file:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
    <key>Label</key>
    <string>com.elastic.filebeat</string>
    <key>ProgramArguments</key>
    <array>
        <string>/Applications/Filebeat/filebeat</string>
        <string>-c</string>
        <string>/Applications/Filebeat/filebeat.yml</string>
    </array>
    <key>KeepAlive</key>
    <true/>
</dict>
</plist>

The error is:

Error: Unable to find launchd plist for job: filebeat Error: /Stage[main]/Filebeat::Service/Service[filebeat]/ensure: change from absent to running failed: Unable to find launchd plist for job: filebeat

Any ideas?

Thanks, Anthony

edit retag flag offensive close merge delete