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

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

Adjustments after latest fresh 'vagrant up' trial

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 user => $user,
62 creates => "${solr_home}/server/solr/configsets/htrc_configs",
63 require => [ File["/home/${user}/htrc_configs.tar.gz"], Exec["rename_solr"] ]
64 }
65
66
67 file {
68 "/home/${user}/solr-init-collection.sh":
69 content => template('solr/solr-init-collection.sh'),
70 ensure => present,
71 mode => 755,
72 owner => $user,
73 group => $group,
74 require => File["/home/${user}"]
75 }
76
77
78}
79
Note: See TracBrowser for help on using the repository browser.