source: other-projects/hathitrust/wcsa/extracted-features-solr/trunk/vagrant-spark-hdfs-cluster/modules/spark/manifests/init.pp@ 31077

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

Move up to JDK1.8. Tidy up of Vagrant machine names. Support for YARN. Some XML whitespace indenting

File size: 1.4 KB
Line 
1class spark {
2
3exec { "download_spark":
4 command => "wget -O /tmp/spark.tar.gz http://d3kbcqa49mib13.cloudfront.net/spark-2.0.1-bin-hadoop2.7.tgz",
5 path => $path,
6# user => $user,
7# group => $user,
8 unless => "ls ${install_dir} | grep spark-2.0.1",
9 require => Package["oracle-java8-installer"]
10 }
11
12exec { "unpack_spark":
13 command => "tar -zxf /tmp/spark.tar.gz -C ${install_dir}",
14 path => $path,
15 creates => "${spark_home}-2.0.1-bin-hadoop2.7",
16 require => Exec["download_spark"]
17 }
18
19exec { "rename_spark":
20 command => "ln -s ${install_dir}/spark-2.0.1-bin-hadoop2.7 ${install_dir}/spark",
21 path => $path,
22 creates => "${spark_home}",
23 require => Exec["unpack_spark"]
24 }
25
26exec { 'chown_spark':
27 command => "/bin/chown -R ${user}:${group} ${spark_home}-2.0.1-bin-hadoop2.7",
28 path => '/bin',
29 user => 'root',
30 require => Exec["rename_spark"]
31 }
32
33file {
34 "${spark_home}/conf/slaves":
35 content => template('spark/slaves'),
36 mode => 644,
37 owner => $user,
38 group => $group,
39 require => Exec["chown_spark"]
40 }
41
42file {
43 "/home/${user}/.bashrc-setup-spark":
44 content => template('spark/setup-spark.bash'),
45 mode => 644,
46 owner => $user,
47 group => $group,
48 require => [ Exec["unpack_spark"], File["/home/${user}"] ]
49 }
50
51file_line { "setup_spark_home":
52 ensure => present,
53 path => "/home/${user}/.bashrc",
54 line => ". .bashrc-setup-spark",
55 require => [ Exec["unpack_spark"], File["/home/${user}"] ]
56 }
57
58
59}
60
Note: See TracBrowser for help on using the repository browser.