96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
|
# File 'manifests/init.pp', line 96
class graphdb (
String $version = undef,
Optional[String] $edition = undef,
Enum['present', 'absent'] $ensure = 'present',
String $status = 'enabled',
Stdlib::Absolutepath $tmp_dir = '/var/tmp/graphdb',
Stdlib::Absolutepath $data_dir = '/var/lib/graphdb',
Stdlib::Absolutepath $log_dir = '/var/log/graphdb',
Stdlib::Absolutepath $pid_dir = '/var/run/graphdb',
Stdlib::Absolutepath $install_dir = '/opt/graphdb',
Stdlib::Absolutepath $import_dir = "${install_dir}/import",
Boolean $manage_graphdb_user = true,
String[1,32] $graphdb_user = 'graphdb',
String[1,32] $graphdb_group = 'graphdb',
Boolean $restart_on_change = true,
Boolean $purge_data_dir = false,
Integer $archive_dl_timeout = 600,
String $graphdb_download_url = 'http://maven.ontotext.com/content/groups/all-onto/com/ontotext/graphdb',
Optional[Stdlib::Absolutepath] $java_home = undef,
Optional[String] $graphdb_download_user = undef,
Optional[String] $graphdb_download_password = undef,
) {
#### Validate parameters
if ($ensure == 'present') {
if (!$version) {
fail('"ensure" is set on present, you should provide "version"')
}
# version
if versioncmp($version, '7.0.0') < 0 {
fail('This module support GraphDB version 7.0.0 and up')
}
if versioncmp($version, '10') < 0 {
if !($edition in ['se', 'ee']) {
fail("\"${edition}\" is not a valid edition parameter value")
}
}
# kernel
$kernel = $facts['kernel']
if !($kernel in ['Linux', 'Darwin', 'OpenBSD']) {
fail("\"${module_name}\" provides no user/group default value for \"${kernel}\"")
}
# service status
if !($status in ['enabled', 'disabled', 'running', 'unmanaged']) {
fail("\"${status}\" is not a valid status parameter value")
}
#basic auth credentials validation
if ($graphdb_download_user and !$graphdb_download_password) or (!$graphdb_download_user and $graphdb_download_password) {
fail('When using basic auth credentials you should provide both graphdb_download_user and graphdb_download_password')
}
if $java_home {
$java_location = $java_home
}
elsif $facts['graphdb_java_home'] {
$java_location = $facts['graphdb_java_home']
}
else {
$java_location = '/usr/lib/jvm/java-8-openjdk-amd64'
}
}
include graphdb::install
include graphdb::tool_links
#### Relationships
if $ensure == 'present' {
Class['graphdb::install']
-> Class['graphdb::tool_links']
-> Graphdb::Instance <| |>
} else {
Graphdb::Instance <| |> -> Class['graphdb::install']
}
}
|