root/other-projects/hathitrust/wcsa/extracted-features-solr/trunk/vagrant-spark-hdfs-cluster/manifests/base-hadoop.pp @ 31077

Revision 31077, 3.2 KB (checked in by davidb, 3 years ago)

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

Line 
1$install_dir = "/opt"
2$hadoop_home = "${install_dir}/hadoop"
3$spark_home  = "${install_dir}/spark"
4
5$user = "htrc"
6$group = "hadoop"
7
8$hadoop_master = '10.10.0.52'
9$hadoop_resman = '10.10.0.50'
10$hadoop_backupmaster = '10.10.0.51'
11$hadoop_1 = '10.10.0.53'
12$hadoop_2 = '10.10.0.54'
13$hadoop_3 = '10.10.0.55'
14
15include hadoop
16include spark
17
18file {
19       "/home/${user}":
20        ensure => "directory",
21        owner  => "${user}",
22        group  => "${group}",
23        mode   => 700,
24        require =>  [ User["${user}"], Group["${group}"] ],
25
26}
27
28group { "${group}":
29  ensure => "present",
30}
31
32user {
33       "${user}":
34        ensure => "present",
35        home => "/home/${user}",
36        name => "${user}",
37        shell => "/bin/bash",
38        managehome => true,
39    gid => $group
40}
41   
42
43 exec { 'add-apt-repository':
44    command => '/usr/bin/add-apt-repository ppa:webupd8team/java -y && \
45                echo debconf shared/accepted-oracle-license-v1-1 select true | /usr/bin/debconf-set-selections && \
46                echo debconf shared/accepted-oracle-license-v1-1 seen true | /usr/bin/debconf-set-selections'
47 }
48
49               
50 exec { 'apt-get update':
51    command => '/usr/bin/apt-get update',
52    require => [ Exec['add-apt-repository'], File["/home/${user}"] ]
53 }
54
55 package { "oracle-java8-installer" :
56   ensure => present,
57  require => [ Exec['apt-get update'], File["/home/${user}"] ]
58 }
59
60
61#package { "subversion" :
62#   ensure => present,
63#  require => [ Exec['apt-get update'], File["/home/${user}"] ]
64#}
65
66#package { "maven" :
67#   ensure => present,
68#  require => [ Exec['apt-get update'], File["/home/${user}"] ]
69#}
70
71file {
72    "/home/${user}/.ssh":
73    ensure => "directory",
74    owner  => "${user}",
75    group  => "${group}",
76    mode   => 750,
77    require => [ Exec['apt-get update'], File["/home/${user}"] ]
78}
79
80file {
81  "/home/${user}/.ssh/id_rsa":
82  source => "puppet:///modules/hadoop/id_rsa",
83  ensure => present,
84  mode => 600,
85  owner => $user,
86  group => $group,
87  require => File["/home/${user}/.ssh"]
88 }
89 
90file {
91  "/home/${user}/.ssh/id_rsa.pub":
92  source => "puppet:///modules/hadoop/id_rsa.pub",
93  ensure => present,
94  mode => 644,
95  owner => $user,
96  group => $group,
97  require => File["/home/${user}/.ssh"]
98 }
99
100ssh_authorized_key { "ssh_key":
101    ensure => "present",
102    key    => "AAAAB3NzaC1yc2EAAAADAQABAAABAQCeHdBPVGuSPVOO+n94j/Y5f8VKGIAzjaDe30hu9BPetA+CGFpszw4nDkhyRtW5J9zhGKuzmcCqITTuM6BGpHax9ZKP7lRRjG8Lh380sCGA/691EjSVmR8krLvGZIQxeyHKpDBLEmcpJBB5yoSyuFpK+4RhmJLf7ImZA7mtxhgdPGhe6crUYRbLukNgv61utB/hbre9tgNX2giEurBsj9CI5yhPPNgq6iP8ZBOyCXgUNf37bAe7AjQUMV5G6JMZ1clEeNPN+Uy5Yrfojrx3wHfG40NuxuMrFIQo5qCYa3q9/SVOxsJILWt+hZ2bbxdGcQOd9AXYFNNowPayY0BdAkSr",
103    type   => "ssh-rsa",
104    user   => "${user}",
105    require => File["/home/${user}/.ssh/id_rsa.pub"]
106}
107
108file{
109  "/home/${user}/.ssh/config":
110  owner => "${user}",
111  group => "${group}",
112  mode => 755,
113  content => "StrictHostKeyChecking no",
114  require => File["/home/${user}/.ssh/id_rsa.pub"]
115}
116
117host { 'master':
118    ip => "${hadoop_master}",
119}
120
121host { 'resman':
122    ip => "${hadoop_resman}",
123}
124
125host { 'backupmaster':
126    ip => "${hadoop_backupmaster}",
127}
128
129host { 'hadoop1':
130    ip => "${hadoop_1}",
131}
132
133host { 'hadoop2':
134    ip => "${hadoop_2}",
135}
136
137host { 'hadoop3':
138    ip => "${hadoop_3}",
139}
140
Note: See TracBrowser for help on using the browser.