Created
March 19, 2015 19:32
-
-
Save ca0abinary/0e8f082536f79c914d98 to your computer and use it in GitHub Desktop.
CoreOS + Etcd + Flannel = Pretty Cool (config.rb)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$new_discovery_url='https://discovery.etcd.io/new' | |
# To automatically replace the discovery token on 'vagrant up', uncomment | |
# the lines below: | |
if File.exists?('user-data') && ARGV[0].eql?('up') | |
require 'open-uri' | |
require 'yaml' | |
token = open($new_discovery_url).read | |
data = YAML.load(IO.readlines('user-data')[1..-1].join) | |
data['coreos']['etcd']['discovery'] = token | |
yaml = YAML.dump(data) | |
File.open('user-data', 'w') { |file| file.write("#cloud-config\n\n#{yaml}") } | |
end | |
# Size of the CoreOS cluster created by Vagrant | |
$num_instances=2 | |
# Official CoreOS channel from which updates should be downloaded | |
$update_channel='stable' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment