author | ymh <ymh.work@gmail.com> |
Fri, 08 Apr 2016 17:53:56 +0200 | |
changeset 146 | dc4d1cdc47e0 |
parent 28 | b0b56e0f8c7f |
child 150 | cb4c47eda2db |
permissions | -rw-r--r-- |
28 | 1 |
class sysconfig::sesame ( |
2 |
) inherits sysconfig::params { |
|
3 |
||
4 |
define create_lexvo_repository($unless = undef) { |
|
5 |
||
6 |
file { "lexvo_tmp_dir": |
|
7 |
path => "/tmp/lexvo", |
|
8 |
ensure => directory, |
|
9 |
}-> |
|
10 |
file { "lexvo_data_archive": |
|
11 |
path => "/tmp/lexvo/lexvo.rdf.bz2", |
|
12 |
ensure => present, |
|
13 |
source => "puppet:///modules/sysconfig/sesame/lexvo_2013-02-09_cleaned.rdf.bz2", |
|
14 |
}-> |
|
15 |
exec { "lexvo_data_extract": |
|
16 |
command => "/usr/bin/bunzip2 /tmp/lexvo/lexvo.rdf.bz2", |
|
17 |
unless => $unless, |
|
18 |
creates => "/tmp/lexvo/lexvo.rdf" |
|
19 |
}-> |
|
20 |
file { "lexvo_commands": |
|
21 |
path => "/tmp/lexvo/console_commands.txt", |
|
22 |
ensure => present, |
|
23 |
source => "puppet:///modules/sysconfig/sesame/console_commands.txt", |
|
24 |
}-> |
|
25 |
exec { "lexvo_console": |
|
26 |
command => "/opt/sesame/bin/console.sh < /tmp/lexvo/console_commands.txt", |
|
27 |
cwd => "/opt/sesame/bin", |
|
146
dc4d1cdc47e0
first implementation of handle install. Need refinement
ymh <ymh.work@gmail.com>
parents:
28
diff
changeset
|
28 |
creates => "/opt/sesame/.lexvo_loaded", |
28 | 29 |
unless => $unless |
30 |
}-> |
|
31 |
exec { "lexvo_data_archive_delete": |
|
32 |
command => "/usr/bin/rm -fr /tmp/lexvo" |
|
146
dc4d1cdc47e0
first implementation of handle install. Need refinement
ymh <ymh.work@gmail.com>
parents:
28
diff
changeset
|
33 |
}-> |
dc4d1cdc47e0
first implementation of handle install. Need refinement
ymh <ymh.work@gmail.com>
parents:
28
diff
changeset
|
34 |
file { "/opt/sesame/.lexvo_loaded": |
dc4d1cdc47e0
first implementation of handle install. Need refinement
ymh <ymh.work@gmail.com>
parents:
28
diff
changeset
|
35 |
ensure => present, |
dc4d1cdc47e0
first implementation of handle install. Need refinement
ymh <ymh.work@gmail.com>
parents:
28
diff
changeset
|
36 |
content => "", |
28 | 37 |
} |
38 |
||
39 |
#-> |
|
40 |
# File <| title == "lexvo_tmp_dir" |> { |
|
41 |
# path => "/tmp/lexvo", |
|
42 |
# ensure => absent, |
|
43 |
# } |
|
44 |
} |
|
45 |
||
46 |
file { "/opt/sesame": |
|
47 |
ensure => directory, |
|
48 |
}-> |
|
49 |
archive { 'openrdf-sesame-4': |
|
50 |
ensure => present, |
|
51 |
url => "http://sourceforge.net/projects/sesame/files/Sesame%204/4.0.1/openrdf-sesame-4.0.1-sdk.tar.gz/download", |
|
52 |
checksum => false, |
|
53 |
follow_redirects => true, |
|
54 |
strip_components => 1, |
|
55 |
target => "/opt/sesame", |
|
56 |
src_target => '/tmp', |
|
57 |
timeout => 500, |
|
58 |
}-> |
|
59 |
file { [ "/var/lib/sesame", |
|
60 |
"/var/lib/sesame/data" ]: |
|
61 |
ensure => directory, |
|
62 |
owner => "tomcat", |
|
63 |
group => "tomcat", |
|
64 |
require => Package['tomcat'] |
|
65 |
}-> |
|
66 |
augeas { "etc-sysconfig/tomcat": |
|
67 |
context => "/files/etc/sysconfig/tomcat", |
|
68 |
changes => [ |
|
69 |
"set JAVA_OPTS '\"-Dinfo.aduna.platform.appdata.basedir=/var/lib/sesame/data -Xms512m -Xmx512m\"'" |
|
70 |
], |
|
71 |
notify => Service['tomcat'] |
|
72 |
}-> |
|
73 |
exec { "copy-sesame-tomcat": |
|
74 |
command => "/usr/bin/cp /opt/sesame/war/*.war /var/lib/tomcat/webapps", |
|
75 |
notify => Service['tomcat'] |
|
76 |
}-> |
|
77 |
create_lexvo_repository { "create-lexvo-repository": |
|
78 |
unless => '/usr/bin/curl -s -f -I http://localhost:8080/openrdf-sesame/repositories/lexvo/statements' |
|
79 |
} |
|
80 |
||
81 |
||
82 |
# |
|
83 |
#download archive |
|
84 |
||
85 |
#put war at the right place |
|
86 |
||
87 |
#create the repository if not exists |
|
88 |
||
89 |
} |