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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
|
# File 'manifests/install/app.pp', line 30
define openondemand::install::app (
String $ensure = 'present',
String $package = "ondemand-${name}",
Boolean $manage_package = true,
Optional[String] $git_repo = undef,
Optional[String] $git_revision = undef,
Optional[String] $source = undef,
Optional[Stdlib::Absolutepath] $path = undef,
String $owner = 'root',
String $group = 'root',
String $mode = '0755',
) {
include openondemand
$_path = pick($path, "${openondemand::web_directory}/apps/sys/${name}")
if $source {
$recurse = 'remote'
} else {
$recurse = undef
}
if $manage_package and ! $git_repo {
ensure_resource('package', $package, {
'ensure' => $ensure,
'require' => Package['ondemand'],
})
}
if $git_repo {
vcsrepo { $_path:
ensure => $ensure,
source => $git_repo,
revision => $git_revision,
provider => 'git',
require => Package['ondemand'],
}
}
if $ensure != 'absent' {
file { $_path:
ensure => 'directory',
owner => $owner,
group => $group,
mode => $mode,
source => $source,
recurse => $recurse,
}
if $manage_package and ! $git_repo {
Package[$package] -> File[$_path]
}
if $git_repo {
Vcsrepo[$_path] -> File[$_path]
}
}
}
|