Skip to content
This repository was archived by the owner on Mar 20, 2026. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 37 additions & 9 deletions Vagrantfile
Original file line number Diff line number Diff line change
Expand Up @@ -35,22 +35,38 @@ def loadProfile()
}
end

# Pull the HDP version out of the hdp.repo file
def findVersion()
fileObj = File.new('files/repos/hdp.repo', 'r')
# Pull the HDP version out of the repository file.
def findVersion(profile)
if (profile[:os] == "centos")
path = 'files/repos/hdp.repo.%s' % profile[:hdp_short_version]
elsif (profile[:os] == "ubuntu")
path = 'files/repos/hdp.list.%s' % profile[:hdp_short_version]
end

fileObj = File.new(path, 'r')
match = /^#VERSION_NUMBER=(?<ver>[-0-9.]*)/.match(fileObj.gets)
fileObj.close()
result = match['ver']
puts "HDP Version = %s\n" % result
puts "HDP Build = %s\n" % result
return result
end

###############################################################################
# Define cluster

profile = loadProfile()
hdp_version = findVersion()
rpm_version = hdp_version.gsub /[.-]/, '_'

# Set defaults.
default_os = "centos"
default_hdp_short_version = "2.2.6"
default_ambari_version = "2.1.0"
default_java_version = "java-1.7.0-openjdk"

profile[:hdp_short_version] ||= default_hdp_short_version
profile[:ambari_version] ||= default_ambari_version
profile[:java_version] ||= default_java_version
profile[:os] ||= default_os
hdp_version = findVersion(profile)

Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
if Vagrant.has_plugin?("vagrant-cachier")
Expand All @@ -60,7 +76,15 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|

# All Vagrant configuration is done here. The most common configuration
# Every Vagrant virtual environment requires a box to build off of.
config.vm.box = "omalley/centos6_x64"
if (profile[:os] == "centos")
config.vm.box = "omalley/centos6_x64"
package_version = "_" + (hdp_version.gsub /[.-]/, '_')
start_script_path = "rc.d/init.d"
elsif (profile[:os] == "ubuntu")
config.vm.box = "ubuntu/trusty64"
package_version = "-" + (hdp_version.gsub /[.-]/, '-')
start_script_path = "init.d"
end

config.vm.provider :virtualbox do |vb|
vb.customize ["modifyvm", :id, "--memory", profile[:vm_mem] ]
Expand All @@ -81,18 +105,22 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
"--verbose", "--debug",
"--fileserverconfig=/vagrant/fileserver.conf"]
puppet.facter = {
"hdp_short_version" => profile[:hdp_short_version],
"ambari_version" => profile[:ambari_version],
"package_version" => package_version,
"start_script_path" => start_script_path,

"hostname" => node[:hostname],
"roles" => node[:roles],
"nodes" => profile[:nodes],
"hdp_version" => hdp_version,
"rpm_version" => rpm_version,
"domain" => profile[:domain],
"security" => profile[:security],
"realm" => profile[:realm],
"clients" => profile[:clients],
"server_mem" => profile[:server_mem],
"client_mem" => profile[:client_mem],
"profile" => profile
"profile" => profile,
}
end
end
Expand Down
15 changes: 15 additions & 0 deletions files/repos/ambari.repo.1.6.1
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
[ambari-1.x]
name=Ambari 1.x
baseurl=http://public-repo-1.hortonworks.com/ambari/centos6/1.x/GA
gpgcheck=1
gpgkey=http://public-repo-1.hortonworks.com/ambari/centos6/RPM-GPG-KEY/RPM-GPG-KEY-Jenkins
enabled=1
priority=1

[Updates-ambari-1.6.1]
name=ambari-1.6.1 - Updates
baseurl=http://public-repo-1.hortonworks.com/ambari/centos6/1.x/updates/1.6.1
gpgcheck=1
gpgkey=http://public-repo-1.hortonworks.com/ambari/centos6/RPM-GPG-KEY/RPM-GPG-KEY-Jenkins
enabled=1
priority=1
15 changes: 15 additions & 0 deletions files/repos/ambari.repo.1.7.0
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
[ambari-1.x]
name=Ambari 1.x
baseurl=http://public-repo-1.hortonworks.com/ambari/centos6/1.x/GA
gpgcheck=1
gpgkey=http://public-repo-1.hortonworks.com/ambari/centos6/RPM-GPG-KEY/RPM-GPG-KEY-Jenkins
enabled=1
priority=1

[Updates-ambari-1.7.0]
name=ambari-1.7.0 - Updates
baseurl=http://public-repo-1.hortonworks.com/ambari/centos6/1.x/updates/1.7.0
gpgcheck=1
gpgkey=http://public-repo-1.hortonworks.com/ambari/centos6/RPM-GPG-KEY/RPM-GPG-KEY-Jenkins
enabled=1
priority=1
7 changes: 7 additions & 0 deletions files/repos/ambari.repo.2.0.2
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
[Updates-ambari-2.0.2]
name=ambari-2.0.2 - Updates
baseurl=http://public-repo-1.hortonworks.com/ambari/centos6/2.x/updates/2.0.2
gpgcheck=1
gpgkey=http://public-repo-1.hortonworks.com/ambari/centos6/RPM-GPG-KEY/RPM-GPG-KEY-Jenkins
enabled=1
priority=1
File renamed without changes.
3 changes: 3 additions & 0 deletions files/repos/hdp.list.2.2.6
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#VERSION_NUMBER=2.2.6.0-2800
deb http://public-repo-1.hortonworks.com/HDP/ubuntu12/2.x/updates/2.2.6.0 HDP main
deb http://public-repo-1.hortonworks.com/HDP-UTILS-1.1.0.20/repos/ubuntu12 HDP-UTILS main
12 changes: 6 additions & 6 deletions files/repos/hdp.repo
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
#VERSION_NUMBER=2.2.6.0-2800
[HDP-2.2.6.0]
name=HDP Version - HDP-2.2.6.0
baseurl=http://public-repo-1.hortonworks.com/HDP/centos6/2.x/updates/2.2.6.0
#VERSION_NUMBER=2.2.4.2-2
[HDP-2.2.4.2]
name=HDP Version - HDP-2.2.4.2
baseurl=http://public-repo-1.hortonworks.com/HDP/centos6/2.x/updates/2.2.4.2
gpgcheck=1
gpgkey=http://public-repo-1.hortonworks.com/HDP/centos6/2.x/updates/2.2.6.0/RPM-GPG-KEY/RPM-GPG-KEY-Jenkins
gpgkey=http://public-repo-1.hortonworks.com/HDP/centos6/2.x/updates/2.2.4.2/RPM-GPG-KEY/RPM-GPG-KEY-Jenkins
enabled=1
priority=1

Expand All @@ -12,6 +12,6 @@ priority=1
name=HDP Utils Version - HDP-UTILS-1.1.0.20
baseurl=http://public-repo-1.hortonworks.com/HDP-UTILS-1.1.0.20/repos/centos6
gpgcheck=1
gpgkey=http://public-repo-1.hortonworks.com/HDP/centos6/2.x/updates/2.2.6.0/RPM-GPG-KEY/RPM-GPG-KEY-Jenkins
gpgkey=http://public-repo-1.hortonworks.com/HDP/centos6/2.x/updates/2.2.4.2/RPM-GPG-KEY/RPM-GPG-KEY-Jenkins
enabled=1
priority=1
17 changes: 17 additions & 0 deletions files/repos/hdp.repo.1.3.10
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#VERSION_NUMBER=1.3.10.0-24
[HDP-1.3.10.0]
name=Hortonworks Data Platform Version - HDP-1.3.10.0
baseurl=http://public-repo-1.hortonworks.com/HDP/centos6/1.x/updates/1.3.10.0
gpgcheck=0
gpgkey=http://public-repo-1.hortonworks.com/HDP/centos6/1.x/updates/1.3.10.0/RPM-GPG-KEY/RPM-GPG-KEY-Jenkins
enabled=1
priority=1


[HDP-UTILS-1.1.0.16]
name=Hortonworks Data Platform Utils Version - HDP-UTILS-1.1.0.16
baseurl=http://public-repo-1.hortonworks.com/HDP-UTILS-1.1.0.16/repos/centos6
gpgcheck=1
gpgkey=http://public-repo-1.hortonworks.com/HDP/centos6/1.x/updates/1.3.10.0/RPM-GPG-KEY/RPM-GPG-KEY-Jenkins
enabled=1
priority=1
17 changes: 17 additions & 0 deletions files/repos/hdp.repo.2.0.13
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#VERSION_NUMBER=2.0.13.0-43
[HDP-2.0.13.0]
name=Hortonworks Data Platform Version - HDP-2.0.13.0
baseurl=http://public-repo-1.hortonworks.com/HDP/centos6/2.x/updates/2.0.13.0
gpgcheck=1
gpgkey=http://public-repo-1.hortonworks.com/HDP/centos6/2.x/updates/2.0.13.0/RPM-GPG-KEY/RPM-GPG-KEY-Jenkins
enabled=1
priority=1


[HDP-UTILS-1.1.0.16]
name=Hortonworks Data Platform Utils Version - HDP-UTILS-1.1.0.16
baseurl=http://public-repo-1.hortonworks.com/HDP-UTILS-1.1.0.16/repos/centos6
gpgcheck=1
gpgkey=http://public-repo-1.hortonworks.com/HDP/centos6/2.x/updates/2.0.13.0/RPM-GPG-KEY/RPM-GPG-KEY-Jenkins
enabled=1
priority=1
17 changes: 17 additions & 0 deletions files/repos/hdp.repo.2.1.15
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#VERSION_NUMBER=2.1.15.0-946
[HDP-2.1.15.0]
name=Hortonworks Data Platform Version - HDP-2.1.15.0
baseurl=http://public-repo-1.hortonworks.com/HDP/centos6/2.x/updates/2.1.15.0
gpgcheck=1
gpgkey=http://public-repo-1.hortonworks.com/HDP/centos6/2.x/updates/2.1.15.0/RPM-GPG-KEY/RPM-GPG-KEY-Jenkins
enabled=1
priority=1


[HDP-UTILS-1.1.0.19]
name=Hortonworks Data Platform Utils Version - HDP-UTILS-1.1.0.19
baseurl=http://public-repo-1.hortonworks.com/HDP-UTILS-1.1.0.19/repos/centos6
gpgcheck=1
gpgkey=http://public-repo-1.hortonworks.com/HDP/centos6/2.x/updates/2.1.15.0/RPM-GPG-KEY/RPM-GPG-KEY-Jenkins
enabled=1
priority=1
17 changes: 17 additions & 0 deletions files/repos/hdp.repo.2.3.0
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#VERSION_NUMBER=2.3.0.0-2557
[HDP-2.3.0.0]
name=HDP Version - HDP-2.3.0.0
baseurl=http://public-repo-1.hortonworks.com/HDP/centos6/2.x/updates/2.3.0.0
gpgcheck=1
gpgkey=http://public-repo-1.hortonworks.com/HDP/centos6/2.x/updates/2.3.0.0/RPM-GPG-KEY/RPM-GPG-KEY-Jenkins
enabled=1
priority=1


[HDP-UTILS-1.1.0.20]
name=HDP Utils Version - HDP-UTILS-1.1.0.20
baseurl=http://public-repo-1.hortonworks.com/HDP-UTILS-1.1.0.20/repos/centos6
gpgcheck=1
gpgkey=http://public-repo-1.hortonworks.com/HDP/centos6/2.x/updates/2.3.0.0/RPM-GPG-KEY/RPM-GPG-KEY-Jenkins
enabled=1
priority=1
6 changes: 3 additions & 3 deletions modules/hbase_client/manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -35,14 +35,14 @@
content => template('hbase_client/zk-jaas.erb'),
}
->
Package["hbase_${rpm_version}"]
Package["hbase${package_version}"]
}

package { "hbase_${rpm_version}":
package { "hbase${package_version}":
ensure => installed,
}
->
package { "phoenix_${rpm_version}":
package { "phoenix${package_version}":
ensure => installed,
}
->
Expand Down
23 changes: 20 additions & 3 deletions modules/hbase_master/manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,27 @@
class hbase_master {
require hbase_server

$path="/usr/bin"
$path="/bin:/sbin:/usr/bin"

package { "hbase_${rpm_version}-master" :
ensure => installed,
case $operatingsystem {
'centos': {
package { "hbase${package_version}-master" :
ensure => installed,
}
}
# XXX: Work around BUG-39010.
'ubuntu': {
exec { "apt-get download hbase${package_version}-master":
cwd => "/tmp",
path => "$path",
}
->
exec { "dpkg -i --force-overwrite hbase${package_version}*master*.deb":
cwd => "/tmp",
path => "$path",
user => "root",
}
}
}
->
exec { "hdp-select set hbase-master ${hdp_version}":
Expand Down
29 changes: 26 additions & 3 deletions modules/hbase_regionserver/manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,33 @@
class hbase_regionserver {
require hbase_server

$path="/usr/bin"
$path="/bin:/sbin:/usr/bin"

package { "hbase_${rpm_version}-regionserver" :
ensure => installed,
case $operatingsystem {
'centos': {
package { "hbase${package_version}-regionserver" :
ensure => installed,
}
}
# XXX: Work around BUG-39010.
'ubuntu': {
exec { "apt-get download hbase${package_version}-regionserver":
cwd => "/tmp",
path => "$path",
}
->
exec { "dpkg -i --force-overwrite hbase${package_version}*.deb":
cwd => "/tmp",
path => "$path",
user => "root",
}
# Fix incorrect startup script permissions (XXX: Is a bug filed for this?).
->
file { "/usr/hdp/${hdp_version}/etc/init.d/hbase-regionserver":
ensure => file,
mode => '755',
}
}
}
->
exec { "hdp-select set hbase-regionserver ${hdp_version}":
Expand Down
39 changes: 27 additions & 12 deletions modules/hdfs_client/manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
$pid_dir="/var/run/pid"
$keytab_dir="/etc/security/hadoop"

package { "hadoop_${rpm_version}":
package { "hadoop${package_version}":
ensure => installed,
}
->
Expand All @@ -34,22 +34,30 @@
path => "$path",
}

package { "hadoop_${rpm_version}-libhdfs":
ensure => installed,
require => Package["hadoop_${rpm_version}"],
if ($operatingsystem == "centos") {
package { "hadoop${package_version}-libhdfs":
ensure => installed,
require => Package["hadoop${package_version}"],
}
}
elsif ($operatingsystem == "ubuntu") {
package { "libhdfs0${package_version}":
ensure => installed,
require => Package["hadoop${package_version}"],
}
}

package { "hadoop_${rpm_version}-client":
package { "hadoop${package_version}-client":
ensure => installed,
require => Package["hadoop_${rpm_version}"],
require => Package["hadoop${package_version}"],
}

package { "hadooplzo_${rpm_version}":
package { "hadooplzo${package_version}":
ensure => installed,
require => Package["hadoop_${rpm_version}"],
require => Package["hadoop${package_version}"],
}
->
package { "hadooplzo_${rpm_version}-native":
package { "hadooplzo${package_version}-native":
ensure => installed,
}

Expand All @@ -61,8 +69,15 @@
ensure => installed,
}

package { 'lzo':
ensure => installed,
if ($operatingsystem == "centos") {
package { 'lzo':
ensure => installed,
}
}
elsif ($operatingsystem == "ubuntu") {
package { 'liblzo2-2':
ensure => installed,
}
}

file { '/etc/hadoop':
Expand All @@ -76,7 +91,7 @@
file { '/etc/hadoop/conf':
ensure => 'link',
target => "${conf_dir}",
require => Package["hadoop_${rpm_version}"],
require => Package["hadoop${package_version}"],
force => true
}

Expand Down
Loading