Merge pull request #79 from jblaine/master

Use Puppetlabs repo site, not gems
This commit is contained in:
R. Tyler Croy 2013-04-26 10:02:10 -07:00
commit 27ff9d29aa
5 changed files with 40 additions and 9 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

@ -74,6 +74,32 @@ module Blimpy
fleet.start
end
desc 'show', 'Show blimp details for running blimps'
method_options :tags => :boolean
def show
ensure_blimpfile
blimps = current_blimps
unless blimps
puts 'No currently running VMs'
exit 0
end
tags_option = options[:tags]
blimps.each do |blimp, data|
if tags_option
tags = nil
data[:tags].each do |k,v|
if tags.nil?
tags = "#{k}=#{v}"
elsif
tags = "#{tags},#{k}=#{v}"
end
end
puts "#{data[:name]} #{data[:internal_dns]} #{tags}"
end
end
end
desc 'status', 'Show running blimps'
def status
ensure_blimpfile

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!

View File

@ -51,12 +51,14 @@ else
Ubuntu) export PATH=/var/lib/gems/1.8/bin:/usr/local/bin:$PATH
which puppet > /dev/null 2>&1
if [ $? -ne 0 ]; then
# CODENAME is 'precise', 'oneiric', etc.
CODENAME=`lsb_release -c | awk '{print $2}'`
REPO_DEB="puppetlabs-release-${CODENAME}.deb"
wget --quiet http://apt.puppetlabs.com/${REPO_DEB} || Fatal "Could not retrieve http://apt.puppetlabs.com/${REPO_DEB}"
dpkg -i ${REPO_DEB} || Fatal "Could not install Puppet repo source '${REPO_DEB}'"
rm -f ${REPO_DEB}
apt-get update
apt-get install -y ruby1.8 \
ruby1.8-dev \
libopenssl-ruby1.8 \
rubygems
gem install puppet --version "~> 2.7" --no-ri --no-rdoc
apt-get -qqy install puppet-common=2.7.* puppet=2.7.* hiera=1.1.* hiera-puppet=1.0* || Fatal "Could not install Puppet"
fi
;;
*) Fatal "Unsupported Linux flavor: $LINUXFLAVOR"