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", |
|
28 |
unless => $unless |
|
29 |
}-> |
|
30 |
exec { "lexvo_data_archive_delete": |
|
31 |
command => "/usr/bin/rm -fr /tmp/lexvo" |
|
32 |
} |
|
33 |
|
|
34 |
#-> |
|
35 |
# File <| title == "lexvo_tmp_dir" |> { |
|
36 |
# path => "/tmp/lexvo", |
|
37 |
# ensure => absent, |
|
38 |
# } |
|
39 |
} |
|
40 |
|
|
41 |
file { "/opt/sesame": |
|
42 |
ensure => directory, |
|
43 |
}-> |
|
44 |
archive { 'openrdf-sesame-4': |
|
45 |
ensure => present, |
|
46 |
url => "http://sourceforge.net/projects/sesame/files/Sesame%204/4.0.1/openrdf-sesame-4.0.1-sdk.tar.gz/download", |
|
47 |
checksum => false, |
|
48 |
follow_redirects => true, |
|
49 |
strip_components => 1, |
|
50 |
target => "/opt/sesame", |
|
51 |
src_target => '/tmp', |
|
52 |
timeout => 500, |
|
53 |
}-> |
|
54 |
file { [ "/var/lib/sesame", |
|
55 |
"/var/lib/sesame/data" ]: |
|
56 |
ensure => directory, |
|
57 |
owner => "tomcat", |
|
58 |
group => "tomcat", |
|
59 |
require => Package['tomcat'] |
|
60 |
}-> |
|
61 |
augeas { "etc-sysconfig/tomcat": |
|
62 |
context => "/files/etc/sysconfig/tomcat", |
|
63 |
changes => [ |
|
64 |
"set JAVA_OPTS '\"-Dinfo.aduna.platform.appdata.basedir=/var/lib/sesame/data -Xms512m -Xmx512m\"'" |
|
65 |
], |
|
66 |
notify => Service['tomcat'] |
|
67 |
}-> |
|
68 |
exec { "copy-sesame-tomcat": |
|
69 |
command => "/usr/bin/cp /opt/sesame/war/*.war /var/lib/tomcat/webapps", |
|
70 |
notify => Service['tomcat'] |
|
71 |
}-> |
|
72 |
create_lexvo_repository { "create-lexvo-repository": |
|
73 |
unless => '/usr/bin/curl -s -f -I http://localhost:8080/openrdf-sesame/repositories/lexvo/statements' |
|
74 |
} |
|
75 |
|
|
76 |
|
|
77 |
# |
|
78 |
#download archive |
|
79 |
|
|
80 |
#put war at the right place |
|
81 |
|
|
82 |
#create the repository if not exists |
|
83 |
|
|
84 |
} |