source: other-projects/hathitrust/vagrant-hadoop-cluster/trunk/manifests/base-hadoop.pp@ 30903

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

Vagrant provisioning files for a 4-node Hadoop cluster. See README.txt for more details

File size: 2.4 KB
Line 
1$install_dir = "/opt"
2$hadoop_home = "${install_dir}/hadoop"
3$user = "ubuntu"
4$group = "ubuntu"
5$hadoop_master = '10.10.0.52'
6$hadoop_backup = '10.10.0.51'
7$hadoop_1 = '10.10.0.53'
8$hadoop_2 = '10.10.0.54'
9$hadoop_3 = '10.10.0.55'
10
11include hadoop
12
13file {
14 "/home/${user}":
15 ensure => "directory",
16 owner => "${user}",
17 group => "${group}",
18 mode => 700,
19 require => [ User["${user}"], Group["${group}"] ],
20
21}
22
23group { "${group}":
24 ensure => "present",
25}
26
27user {
28 "${user}":
29 ensure => "present",
30 home => "/home/${user}",
31 name => "${user}",
32 shell => "/bin/bash",
33 managehome => true,
34 gid => $group
35}
36
37
38
39exec { 'apt-get update':
40 command => '/usr/bin/apt-get update',
41}
42
43package { "openjdk-7-jdk" :
44 ensure => present,
45 require => [ Exec['apt-get update'], File["/home/${user}"] ]
46}
47
48
49file {
50 "/home/${user}/.ssh":
51 ensure => "directory",
52 owner => "${user}",
53 group => "${user}",
54 mode => 750,
55 require => [ Exec['apt-get update'], File["/home/${user}"] ]
56}
57
58file {
59 "/home/${user}/.ssh/id_rsa":
60 source => "puppet:///modules/hadoop/id_rsa",
61 ensure => present,
62 mode => 600,
63 owner => $user,
64 group => $group,
65 require => File["/home/${user}/.ssh"]
66 }
67
68file {
69 "/home/${user}/.ssh/id_rsa.pub":
70 source => "puppet:///modules/hadoop/id_rsa.pub",
71 ensure => present,
72 mode => 644,
73 owner => $user,
74 group => $group,
75 require => File["/home/${user}/.ssh"]
76 }
77
78ssh_authorized_key { "ssh_key":
79 ensure => "present",
80 key => "AAAAB3NzaC1yc2EAAAADAQABAAABAQCeHdBPVGuSPVOO+n94j/Y5f8VKGIAzjaDe30hu9BPetA+CGFpszw4nDkhyRtW5J9zhGKuzmcCqITTuM6BGpHax9ZKP7lRRjG8Lh380sCGA/691EjSVmR8krLvGZIQxeyHKpDBLEmcpJBB5yoSyuFpK+4RhmJLf7ImZA7mtxhgdPGhe6crUYRbLukNgv61utB/hbre9tgNX2giEurBsj9CI5yhPPNgq6iP8ZBOyCXgUNf37bAe7AjQUMV5G6JMZ1clEeNPN+Uy5Yrfojrx3wHfG40NuxuMrFIQo5qCYa3q9/SVOxsJILWt+hZ2bbxdGcQOd9AXYFNNowPayY0BdAkSr",
81 type => "ssh-rsa",
82 user => "${user}",
83 require => File["/home/${user}/.ssh/id_rsa.pub"]
84}
85
86file{
87 "/home/${user}/.ssh/config":
88 owner => "${user}",
89 group => "${group}",
90 mode => 755,
91 content => "StrictHostKeyChecking no",
92 require => File["/home/${user}/.ssh/id_rsa.pub"]
93}
94
95host { 'hadoop1':
96 ip => "${hadoop_1}",
97}
98
99host { 'hadoop2':
100 ip => "${hadoop_2}",
101}
102
103host { 'hadoop3':
104 ip => "${hadoop_3}",
105}
106
107host { 'master':
108 ip => "${hadoop_master}",
109}
110
111host { 'backup':
112 ip => "${hadoop_backup}",
113}
Note: See TracBrowser for help on using the repository browser.