Skip to content
This repository
Browse code

Merge pull request #79 from jblaine/master

Use Puppetlabs repo site, not gems
  • Loading branch information...
commit 27ff9d29aa19f5efdee3078213abf404744afa9d 2 parents bf307f6 + e6f171b
R. Tyler Croy authored
1  README.md
Source Rendered
@@ -49,6 +49,7 @@ Here's an example Blimpfile:
49 49
             ship.username = 'ubuntu' # [Optional] SSH username, defaults to "ubuntu" for AWS machines
50 50
             ship.flavor = 'm1.small' # [Optional] defaults to t1.micro
51 51
             ship.tags = {:mytag => 'somevalue'} # [Optional]
  52
+            ship.provision_on_start = false # [Optional] defaults to true
52 53
         end
53 54
     end
54 55
 ```
4  lib/blimpy/box.rb
@@ -14,7 +14,7 @@ class Box
14 14
     attr_accessor :image_id, :flavor, :group, :ports
15 15
     attr_accessor :dns, :internal_dns
16 16
     attr_accessor :name, :tags, :fleet_id, :username, :ssh_port, :livery
17  
-
  17
+    attr_accessor :provision_on_start
18 18
 
19 19
     def self.from_instance_id(an_id, data)
20 20
       return if data[:type].nil?
@@ -33,6 +33,7 @@ def self.from_instance_id(an_id, data)
33 33
     end
34 34
 
35 35
     def initialize(server=nil)
  36
+      @provision_on_start = true
36 37
       @livery = nil
37 38
       @group = nil
38 39
       @name = 'Unnamed Box'
@@ -161,7 +162,6 @@ def wait_for_state(until_state, &block)
161 162
       end
162 163
     end
163 164
 
164  
-
165 165
     def with_data(ship_id, data)
166 166
       data.each do |key, value|
167 167
         next if immutable_attributes.include? key.to_sym
26  lib/blimpy/cli.rb
@@ -74,6 +74,32 @@ def start
74 74
       fleet.start
75 75
     end
76 76
 
  77
+    desc 'show', 'Show blimp details for running blimps'
  78
+    method_options :tags => :boolean
  79
+    def show
  80
+      ensure_blimpfile
  81
+      blimps = current_blimps
  82
+      unless blimps
  83
+        puts 'No currently running VMs'
  84
+        exit 0
  85
+      end
  86
+
  87
+      tags_option = options[:tags]
  88
+      blimps.each do |blimp, data|
  89
+        if tags_option
  90
+          tags = nil
  91
+          data[:tags].each do |k,v|
  92
+            if tags.nil?
  93
+              tags = "#{k}=#{v}"
  94
+            elsif
  95
+              tags = "#{tags},#{k}=#{v}"
  96
+            end
  97
+          end
  98
+          puts "#{data[:name]} #{data[:internal_dns]} #{tags}"
  99
+        end
  100
+      end
  101
+    end
  102
+
77 103
     desc 'status', 'Show running blimps'
78 104
     def status
79 105
       ensure_blimpfile
6  lib/blimpy/fleet.rb
@@ -124,8 +124,10 @@ def start
124 124
         print "\n"
125 125
         puts ">> #{host.name} online at: #{host.dns}"
126 126
         host.online!
127  
-        host.bootstrap
128  
-        puts
  127
+        if host.provision_on_start
  128
+          host.bootstrap
  129
+          puts
  130
+        end
129 131
       end
130 132
 
131 133
       save!
12  scripts/puppet.sh
@@ -51,12 +51,14 @@ else
51 51
     Ubuntu) export PATH=/var/lib/gems/1.8/bin:/usr/local/bin:$PATH
52 52
             which puppet > /dev/null 2>&1
53 53
             if [ $? -ne 0 ]; then
  54
+              # CODENAME is 'precise', 'oneiric', etc.
  55
+              CODENAME=`lsb_release -c | awk '{print $2}'`
  56
+              REPO_DEB="puppetlabs-release-${CODENAME}.deb"
  57
+              wget --quiet http://apt.puppetlabs.com/${REPO_DEB} || Fatal "Could not retrieve http://apt.puppetlabs.com/${REPO_DEB}"
  58
+              dpkg -i ${REPO_DEB} || Fatal "Could not install Puppet repo source '${REPO_DEB}'"
  59
+              rm -f ${REPO_DEB}
54 60
               apt-get update
55  
-              apt-get install -y ruby1.8 \
56  
-                                 ruby1.8-dev \
57  
-                                 libopenssl-ruby1.8 \
58  
-                                 rubygems
59  
-              gem install puppet --version "~> 2.7" --no-ri --no-rdoc
  61
+              apt-get -qqy install puppet-common=2.7.* puppet=2.7.* hiera=1.1.* hiera-puppet=1.0* || Fatal "Could not install Puppet"
60 62
             fi
61 63
             ;;
62 64
     *) Fatal "Unsupported Linux flavor: $LINUXFLAVOR"

0 notes on commit 27ff9d2

Please sign in to comment.
Something went wrong with that request. Please try again.