5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
|
# File 'manifests/init.pp', line 5
class homebrew (
String[1] $path = '/usr/local',
Variant[String[1], Integer] $owner = $facts['id'],
Variant[String[1], Integer] $group = $facts['gid'],
String[1] $repo = 'https://github.com/Homebrew/brew',
Hash[String[1], Hash] $taps = {},
Array[String[1]] $formulae = [],
Array[String[1]] $casks = []
) {
vcsrepo { $path:
ensure => present,
provider => git,
source => $repo,
owner => $owner,
group => $group
}
sudoers::allowed_command{ 'cask_installer':
command => '/usr/sbin/installer',
user => $facts['id'],
require_password => false,
require_exist => false,
tags => ['SETENV'],
comment => 'Allows homebrew to install casks'
}
create_resources(homebrew::tap, $taps)
$formulae.each |String[1] $formula| {
package { $formula:
provider => brew
}
}
$casks.each |String[1] $cask| {
package { $cask:
provider => cask
}
}
Homebrew::Tap <| |> -> Package <| provider == brew |>
Homebrew::Tap <| |> -> Package <| provider == cask |>
}
|