aboutsummaryrefslogtreecommitdiff
path: root/bigtop-deploy
diff options
context:
space:
mode:
authorYoungWoo Kim <ywkim@apache.org>2015-04-06 17:46:29 +0900
committerEvans Ye <evansye@apache.org>2015-04-23 15:06:53 +0000
commitd2c2126a665624a7684425f563a055db5cabe3c1 (patch)
tree7a6a5ca9a6c3e2ec9dded7c2ffb6b6df04a19e98 /bigtop-deploy
parent083f61384af123695dac800395ee4f73ab60086f (diff)
BIGTOP-1803: Overide Vagrant configurations from environment variables
Signed-off-by: Evans Ye <evansye@apache.org>
Diffstat (limited to 'bigtop-deploy')
-rw-r--r--bigtop-deploy/vm/vagrant-puppet-vm/README.md13
-rwxr-xr-xbigtop-deploy/vm/vagrant-puppet-vm/Vagrantfile13
2 files changed, 26 insertions, 0 deletions
diff --git a/bigtop-deploy/vm/vagrant-puppet-vm/README.md b/bigtop-deploy/vm/vagrant-puppet-vm/README.md
index 1de9089c..2b21a706 100644
--- a/bigtop-deploy/vm/vagrant-puppet-vm/README.md
+++ b/bigtop-deploy/vm/vagrant-puppet-vm/README.md
@@ -73,6 +73,19 @@ finally, spin up the cluster
vagrant up
```
+## Override Vagrant configurations
+You can override vagrant configurations from environment variables:
+```
+$ export REPO=http://repo.example.com/path/to
+$ vagrant up
+```
+
+or
+
+```
+$ MEMORY_SIZE=8000 vagrant up
+```
+
##Configure Apache Hadoop ecosystem components
* Choose the ecosystem you want to be deployed by modifying components in vagrantconfig.yaml
diff --git a/bigtop-deploy/vm/vagrant-puppet-vm/Vagrantfile b/bigtop-deploy/vm/vagrant-puppet-vm/Vagrantfile
index 5384b8cb..6a16ae3a 100755
--- a/bigtop-deploy/vm/vagrant-puppet-vm/Vagrantfile
+++ b/bigtop-deploy/vm/vagrant-puppet-vm/Vagrantfile
@@ -21,6 +21,19 @@ require "yaml"
_config = YAML.load(File.open(File.join(File.dirname(__FILE__), "vagrantconfig.yaml"), File::RDONLY).read)
CONF = _config
+# Override vagrant configurations using environment variables
+keys = CONF.keys
+keys.each do |k|
+ if ENV[k.upcase] != nil then
+ puts "Overide from environment variable: " + k.upcase + " = " + ENV[k.upcase]
+ if /^\d+/.match(ENV[k.upcase])
+ CONF[k] = Integer(ENV[k.upcase])
+ else
+ CONF[k] = ENV[k.upcase]
+ end
+ end
+end
+
# Repository
# Example for testing a Release candidate.
repo = CONF['repo']