Puppet Class: serverless::darwin

Defined in:
manifests/darwin.pp

Overview

Set up serverless runs on Macs



3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
# File 'manifests/darwin.pp', line 3

class serverless::darwin {
  $repodir = $serverless::repodir
  $bindir = $serverless::bindir
  $frequency = $serverless::frequency

  file { $bindir:
    ensure => directory,
  }
  -> file { "${bindir}/puppet-run":
    ensure => link,
    target => "${repodir}/meta/puppet-run",
  }

  file { '/Library/LaunchDaemons/com.halyard.puppet-run.plist':
    ensure  => 'file',
    content => template('serverless/puppet-run.launchd.erb'),
    notify  => Exec['Puppet-run refresh launchd'],
  }

  exec { 'Puppet-run refresh launchd':
    command     => 'launchctl load -wF /Library/LaunchDaemons/com.halyard.puppet-run.plist',
    refreshonly => true,
    path        => ['/usr/bin', '/bin'],
    user        => 'root',
  }
}