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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
|
# File 'manifests/utilities/alfred.pp', line 10
class software::utilities::alfred (
$ensure = $software::params::software_ensure,
$applications_path = $software::params::applications_path,
$utilities_path = $software::params::utilities_path,
$version = $software::params::alfred_version,
$url = $software::params::alfred_url,
) inherits software::params {
validate_string($ensure)
case $::operatingsystem {
'Darwin': {
validate_absolute_path($applications_path)
validate_absolute_path($utilities_path)
validate_string($version)
validate_string($url)
$app = 'Alfred 2.app'
$app_path = "${applications_path}/${app}"
$util_path = "${utilities_path}/${app}"
package { "Alfred-${version}":
ensure => $ensure,
provider => appcompressed,
source => $url,
} ->
# Move to /Applications/Utilities/
exec { "Alfred-${version}->Utilities":
command => "rm -rf '${util_path}' && mv '${app_path}' '${util_path}'",
onlyif => "test -e '${app_path}'",
path => ['/bin', '/usr/bin', '/sbin', '/usr/sbin', '/usr/local/bin', '/usr/local/sbin'],
}
}
'Ubuntu': {
$apt_ppa_ensure = $ensure ? {
'installed' => present,
'latest' => present,
default => $ensure,
}
include '::apt'
apt::ppa { 'ppa:mutate/ppa':
ensure => $apt_ppa_ensure,
} ->
package { 'mutate':
ensure => $ensure,
}
}
default: {
fail("The ${name} class is not supported on ${::operatingsystem}.")
}
}
}
|