]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph-ansible.git/commitdiff
Use an external file to manage Vagrant variables 216/head
authorSébastien Han <sebastien.han@enovance.com>
Mon, 23 Feb 2015 23:07:15 +0000 (00:07 +0100)
committerSébastien Han <sebastien.han@enovance.com>
Mon, 23 Feb 2015 23:09:29 +0000 (00:09 +0100)
This is really handy when we are testing code since we don't need to
modify the Vagrantfile, which is tracked by git.
The next commit will ignore the vagrant_variables.yml file.

Signed-off-by: Sébastien Han <sebastien.han@enovance.com>
.gitignore
Vagrantfile
vagrant_variables.yml [new file with mode: 0644]

index f30a173eb80f3feae0c6ff4e90c2db44cf43311d..eeb5690549aa617319d6fa65aea7a7825cf3cc89 100644 (file)
@@ -2,3 +2,4 @@
 *.vdi
 *.keyring
 fetch/4a158d27-f750-41d5-9e7f-26ce4c9d2d45/*
+vagrant_variables.yml
index df753f22e1814302c283d9ae89b79a3a8ff43bac..14455146af90ee3b0d00bf94c606f110782d10d0 100644 (file)
@@ -1,14 +1,18 @@
 # -*- mode: ruby -*-
 # vi: set ft=ruby :
 
+require 'yaml'
 VAGRANTFILE_API_VERSION = '2'
 
-NMONS   = 3
-NOSDS   = 3
-NMDSS   = 0
-NRGWS   = 0
-CLIENTS = 0
-SUBNET  = '192.168.42'
+config_file=File.expand_path(File.join(File.dirname(__FILE__), 'vagrant_variables.yml'))
+settings=YAML.load_file(config_file)
+
+NMONS   = settings['mon_vms']
+NOSDS   = settings['osd_vms']
+NMDSS   = settings['mds_vms']
+NRGWS   = settings['rgw_vms']
+CLIENTS = settings['client_vms']
+SUBNET  = settings['subnet']
 
 ansible_provision = proc do |ansible|
   ansible.playbook = 'site.yml'
diff --git a/vagrant_variables.yml b/vagrant_variables.yml
new file mode 100644 (file)
index 0000000..1885532
--- /dev/null
@@ -0,0 +1,11 @@
+---
+
+# DEFINE THE NUMBER OF VMS TO RUN
+mon_vms: 3
+osd_vms: 3
+mds_vms: 0
+rgw_vms: 0
+client_vms: 0
+
+# SUBNET TO USE FOR THE VMS
+subnet: 192.168.42