Intro .provision_on_start flag for ships

Allows control over when the livery provisioning happens for
ships. This was needed because sometimes we don't want to
provision (Puppet) until all ships are up and we know their
hostnames in AWS, etc.
This commit is contained in:
Jeff Blaine 2013-04-25 22:11:53 +00:00
parent 8494a4b66b
commit 5535fc09c6
3 changed files with 7 additions and 4 deletions

View File

@ -49,6 +49,7 @@ Here's an example Blimpfile:
ship.username = 'ubuntu' # [Optional] SSH username, defaults to "ubuntu" for AWS machines
ship.flavor = 'm1.small' # [Optional] defaults to t1.micro
ship.tags = {:mytag => 'somevalue'} # [Optional]
ship.provision_on_start = false # [Optional] defaults to true
end
end
```

View File

@ -14,7 +14,7 @@ module Blimpy
attr_accessor :image_id, :flavor, :group, :ports
attr_accessor :dns, :internal_dns
attr_accessor :name, :tags, :fleet_id, :username, :ssh_port, :livery
attr_accessor :provision_on_start
def self.from_instance_id(an_id, data)
return if data[:type].nil?
@ -33,6 +33,7 @@ module Blimpy
end
def initialize(server=nil)
@provision_on_start = true
@livery = nil
@group = nil
@name = 'Unnamed Box'
@ -161,7 +162,6 @@ module Blimpy
end
end
def with_data(ship_id, data)
data.each do |key, value|
next if immutable_attributes.include? key.to_sym

View File

@ -124,8 +124,10 @@ module Blimpy
print "\n"
puts ">> #{host.name} online at: #{host.dns}"
host.online!
host.bootstrap
puts
if host.provision_on_start
host.bootstrap
puts
end
end
save!