diff --git a/.gitignore b/.gitignore index 75fb01e0c..5df9c10ad 100644 --- a/.gitignore +++ b/.gitignore @@ -15,4 +15,6 @@ debug.test .vagrant/ demo/vagrant/cloud-config.yml -.virtualbox/ \ No newline at end of file +.virtualbox/ + +.discovery-token \ No newline at end of file diff --git a/demo/vagrant/Vagrantfile b/demo/vagrant/Vagrantfile index 39674728d..3a9827894 100644 --- a/demo/vagrant/Vagrantfile +++ b/demo/vagrant/Vagrantfile @@ -9,6 +9,13 @@ $disk_size = 5 require_relative 'util.rb' require 'open-uri' +if File.exists?('.discovery-token') + token = IO.readlines(".discovery-token")[0..-1].join +else + token = open($new_discovery_url).read + File.open(".discovery-token", 'w') { |file| file.write("#{token}") } +end + Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| set_coreos_box(config, $channel) @@ -23,7 +30,7 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| #node.vm.synced_folder "../../release", "/release", id: "release", :nfs => true, :mount_options => ['nolock,vers=3,tcp'] node.vm.provision :cloud_config, :template => "cloud-config.yml.in", - :subst => { "%%token%%" => open($new_discovery_url).read } + :subst => { "%%token%%" => "#{token}" } end end end diff --git a/demo/vagrant/cloud-config.yml.in b/demo/vagrant/cloud-config.yml.in index f20366bcf..9815b7f87 100644 --- a/demo/vagrant/cloud-config.yml.in +++ b/demo/vagrant/cloud-config.yml.in @@ -33,12 +33,11 @@ coreos: Environment=CASTLED_ACI=quay.io/quantum/castled:latest Environment=CASTLED_ID=%m - Environment=CASTLED_DISCOVERY_URL=%%token%% Environment=CASTLED_PUBLIC_IPV4=$public_ipv4 Environment=CASTLED_PRIVATE_IPV4=$private_ipv4 Environment=CASTLED_DATA_DIR=/var/lib/castled Environment=CASTLED_ETCD_MEMBERS=http://$public_ipv4:2379 - #Environment=CASTLED_DATA_DEVICES=sdb,sdc,sdd + Environment=CASTLED_DATA_DEVICES=sda,sdb,sdc,sdd ExecStartPre=/usr/bin/mkdir -p ${CASTLED_DATA_DIR}