Skip to content
Find file
Fetching contributors…
Cannot retrieve contributors at this time
executable file 33 lines (24 sloc) 719 Bytes
#!/usr/bin/env ruby
gemfile = File.expand_path("../../Gemfile", __FILE__)
if File.exists?(gemfile)
ENV["BUNDLE_GEMFILE"] = gemfile
require "rubygems"
require "bundler/setup"
end
$:.unshift(File.expand_path("../../lib", __FILE__))
require 'ami'
REGIONS = %w[ap-northeast-1 ap-southeast-1 eu-west-1 sa-east-1 us-east-1 us-west-1 us-west-2]
config_file = ARGV[0]
config = YAML.load_file(config_file)
fog = Bosh::Ami::Fog.new(config)
fog.loop(REGIONS) do |region, server|
Bosh::Ami::Configurator.new(config, server).configure(region)
end
begin
File.open(config_file, "w") do |file|
YAML.dump(config, file)
end
rescue => e
puts "failed to save host file: #{e.message}"
puts YAML.dump(config)
end
Jump to Line
Something went wrong with that request. Please try again.