One etcd token for machines in same vagrant env
This commit is contained in:
1 parent
6a7cbe7752
commit
18233304d6
3 files changed
+12
-4
No files matched your search
+3
-1
@@ -15,4 +15,6 @@ debug.test
|
||||
.vagrant/
|
||||
demo/vagrant/cloud-config.yml
|
||||
|
||||
.virtualbox/
|
||||
.virtualbox/
|
||||
|
||||
.discovery-token
|
||||
Vendored
+8
-1
@@ -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
|
||||
@@ -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}
|
||||
|
||||
|
||||
Reference in new issue
Block a user