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
176
177
178
179
180
181
182
183
184
|
# File 'manifests/init.pp', line 97
class graphdb (
Integer $archive_dl_timeout = 600,
Stdlib::Absolutepath $data_dir = '/var/lib/graphdb',
Optional[String] $edition = undef,
Graphdb::Ensure $ensure = 'present',
Optional[String] $graphdb_download_password = undef,
Optional[String] $graphdb_download_user = undef,
String $graphdb_download_url = 'http://maven.ontotext.com/content/groups/all-onto/com/ontotext/graphdb',
String[1,32] $graphdb_group = 'graphdb',
String[1,32] $graphdb_user = 'graphdb',
Stdlib::Absolutepath $install_dir = '/opt/graphdb',
Stdlib::Absolutepath $import_dir = "${install_dir}/import",
Optional[Stdlib::Absolutepath] $java_home = undef,
Stdlib::Absolutepath $log_dir = '/var/log/graphdb',
Boolean $manage_graphdb_user = true,
Stdlib::Absolutepath $pid_dir = '/var/run/graphdb',
Boolean $purge_data_dir = false,
Boolean $restart_on_change = true,
Graphdb::Status $status = 'enabled',
Stdlib::Absolutepath $tmp_dir = '/var/tmp/graphdb',
String $version = 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']) {
fail("\"${module_name}\" provides no support for kernel \"${kernel}\"")
}
# os
$operatingsystem = $facts['os']['name']
$operatingsystemmajrelease = $facts['os']['release']['major']
#$operatingsystem = $facts['operatingsystem'] # lint:ignore:legacy_facts
#$operatingsystemmajrelease = $facts['operatingsystemmajrelease'] # lint:ignore:legacy_facts
if !($operatingsystem in ['RedHat', 'CentOS', 'Debian', 'Ubuntu'])
or ($operatingsystem in ['RedHat', 'CentOS'] and versioncmp($operatingsystemmajrelease, '7') < 0)
or ($operatingsystem in ['Debian'] and versioncmp($operatingsystemmajrelease, '8') < 0)
or ($operatingsystem in ['Ubuntu'] and versioncmp($operatingsystemmajrelease, '15') < 0) {
fail("\"${module_name}\" provides no support for \"${operatingsystem}\" \"${operatingsystemmajrelease}\"")
}
#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']
}
}
|