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

Last change on this file since 30960 was 30960, checked in by davidb, 8 years ago

Switch to using Puppet to provision machine. Strongly based on files developed for spark-hdfs cluster

File size: 2.0 KB
Line 
1class zookeeper {
2
3 exec { "download_zookeeper":
4 command => "wget -O /tmp/zookeeper-3.4.9.tar.gz http://www-us.apache.org/dist/zookeeper/zookeeper-3.4.9/zookeeper-3.4.9.tar.gz",
5 timeout => 0,
6 path => $path,
7 unless => "ls ${install_dir} | grep zookeeper-3.4.9",
8 require => Package["oracle-java8-installer"]
9 }
10
11 exec { "unpack_zookeeper":
12 command => "tar -zxf /tmp/zookeeper-3.4.9.tar.gz -C ${install_dir}",
13 path => $path,
14 creates => "${zookeeper_home}-3.4.9",
15 require => Exec["download_zookeeper"]
16 }
17
18 exec { "rename_zookeeper":
19 command => "ln -s ${install_dir}/zookeeper-3.4.9 ${install_dir}/zookeeper",
20 path => $path,
21 creates => "${zookeeper_home}",
22 require => Exec["unpack_zookeeper"]
23 }
24
25 exec { 'chown_zookeeper':
26 command => "/bin/chown -R ${user}:${group} ${zookeeper_home}-3.4.9",
27 path => '/bin',
28 user => 'root',
29 require => Exec["rename_zookeeper"]
30 }
31
32 file {
33 "${zookeeper_home}/conf/zoo.cfg":
34 content => template('zookeeper/zoo.cfg'),
35 mode => 644,
36 owner => $user,
37 group => $group,
38 require => Exec["chown_zookeeper"]
39 }
40
41
42 file { '/var/lib/zookeeper':
43 ensure => 'directory',
44 owner => $user,
45 group => $group,
46 mode => 755,
47 require => Exec["chown_zookeeper"]
48 }
49
50# file {
51# [ "${hadoop_home}/hadoop_store",
52# "${hadoop_home}/hadoop_store/hdfs",
53# "${hadoop_home}/hadoop_store/hdfs/namenode",
54# "${hadoop_home}/hadoop_store/hdfs/datanode"]:
55# ensure => 'directory',
56# owner => "${user}",
57# group => "${group}",
58# mode => 755,
59# require => Exec["chown_hadoop"]
60# }
61
62 file {
63 "/home/${user}/.bashrc-setup-zookeeper":
64 content => template('zookeeper/setup-zookeeper.bash'),
65 mode => 644,
66 owner => $user,
67 group => $group,
68 require => [ Exec["unpack_zookeeper"], File["/home/${user}"] ]
69 }
70
71 file_line { "setup_zookeeper_home":
72 ensure => present,
73 path => "/home/${user}/.bashrc",
74 line => ". .bashrc-setup-zookeeper",
75 require => [ Exec["unpack_zookeeper"], File["/home/${user}"] ]
76 }
77}
78
Note: See TracBrowser for help on using the repository browser.