Skip to content

Instantly share code, notes, and snippets.

@ca0abinary
Created March 19, 2015 19:32
Show Gist options
  • Save ca0abinary/0e8f082536f79c914d98 to your computer and use it in GitHub Desktop.
Save ca0abinary/0e8f082536f79c914d98 to your computer and use it in GitHub Desktop.
CoreOS + Etcd + Flannel = Pretty Cool (config.rb)
$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