source: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/solr/manifests/init.pp@ 30989

Last change on this file since 30989 was 30989, checked in by davidb, 6 years ago

Changes to better suit EF set used with solr

File size: 1.9 KB
Line 
1class solr {
2
3 exec { "download_solr":
4 command => "wget -O /tmp/solr-6.2.1.tar.gz http://www-us.apache.org/dist/lucene/solr/6.2.1/solr-6.2.1.tgz",
5 timeout => 0,
6 path => $path,
7 unless => "ls ${install_dir} | grep solr-6.2.1",
8 require => Package["oracle-java8-installer"]
9 }
10
11 exec { "unpack_solr":
12 command => "tar -zxf /tmp/solr-6.2.1.tar.gz -C ${install_dir}",
13 path => $path,
14 creates => "${solr_home}-6.2.1",
15 require => Exec["download_solr"]
16 }
17
18 exec { "rename_solr":
19 command => "ln -s ${install_dir}/solr-6.2.1 ${install_dir}/solr",
20 path => $path,
21 creates => "${solr_home}",
22 require => Exec["unpack_solr"]
23 }
24
25 exec { 'chown_solr':
26 command => "/bin/chown -R ${user}:${group} ${solr_home}-6.2.1",
27 path => '/bin',
28 user => 'root',
29 require => Exec["rename_solr"]
30 }
31
32 file {
33 "/home/${user}/.bashrc-setup-solr":
34 content => template('solr/setup-solr.bash'),
35 mode => 644,
36 owner => $user,
37 group => $group,
38 require => [ Exec["unpack_solr"], File["/home/${user}"] ]
39 }
40
41 file_line { "setup_solr_home":
42 ensure => present,
43 path => "/home/${user}/.bashrc",
44 line => ". .bashrc-setup-solr",
45 require => [ Exec["unpack_solr"], File["/home/${user}"] ]
46 }
47
48file {
49 "/home/${user}/htrc_configs.tar.gz":
50 source => "puppet:///modules/solr/htrc_configs.tar.gz",
51 ensure => present,
52 mode => 644,
53 owner => $user,
54 group => $group,
55 require => Exec["rename_solr"]
56 }
57
58 exec { "unpack_solr_htrc_configs":
59 command => "tar -zxf /home/${user}/htrc_configs.tar.gz -C ${solr_home}/server/solr/configsets",
60 path => $path,
61 creates => "${solr_home}-6.2.1",
62 require => [ File["/home/${user}/htrc_configs.tar.gz"], Exec["rename_solr"] ]
63 }
64
65
66 file {
67 "/home/${user}/solr-init-collection.sh":
68 content => template('solr/solr-init-collection.sh'),
69 ensure => present,
70 mode => 755,
71 owner => $user,
72 group => $group,
73 require => File["/home/${user}"]
74 }
75
76
77}
78
Note: See TracBrowser for help on using the repository browser.