Commit Graph

47 Commits

Author SHA1 Message Date
R. Tyler Croy 302e0ea555 Sanitize hostnames for keypairs
Fixes #76
2013-06-30 20:44:07 -07:00
Chris Price 456f26cce9 Fix bug causing inconsistent values for security group names
Prior to this commit, when SecurityGroups#ensure_group was
called with a list of ports that there was not yet a
security group for, the array of ports would get wrapped
in `Set.new` twice; once in the body of #group_id and once
in the body of #ensure_group.

It turns out that, based on the implementation of #group_id,
there are cases when you'd get back a different group_id when
you converted the array to a set twice.  So, e.g.:

    Zlib.crc32(Set.new([22,8140]).inspect) !=
Zlib.crc32(Set.new(Set.new([22,8140])).inspect)

but...

    Zlib.crc32(Set.new([22,8080]).inspect) ==
Zlib.crc32(Set.new(Set.new([22,8080])).inspect)

Good times.  This commit tweaks the tests so that they would
repro this issue, and also cleans up the handling of the calls
to `Set.new` so as to fix the bug.
2012-10-03 16:50:39 -07:00
R. Tyler Croy 0ad9815b57 Add a new built-in (and configurable) Puppet livery.
This will allow for easier bootstrapping and configuration of Puppet on a
machine, e.g.:

    Blimpy.fleet do |f|
      f.add(:aws) do |s|
        s.livery = Blimpy::Livery::Puppet.configure |c|
          c.module_path = "test/modules" # This is relative to the Blimpfile's root directory
        end
      end
    end

In a way, this should fix #47
2012-08-25 14:06:36 -07:00
R. Tyler Croy 10916f0c25 Having ruby-debug around inside of the RSpec examples is handy 2012-08-22 22:16:50 -07:00
R. Tyler Croy 9ed4d3ac99 Move the concept of a Livery around to denote an actual class with more "structure"
This effectively breaks the crap out of existing Blimpfiles with a `ship.livery
= :cwd` line, or something similar. I think it's worth it at this point.

Liveries will have some access to the box object itself, so that API will need
to remain consistent for some time. It's expected that every Livery will have
at least:

    * setup_on(box)
    * preflight(box)
    * flight(box)
    * postflight(box)

This should be enough for just about every livery to do what it needs to do
with the created box. This should also allow (in the future) a Livery to
express variables or other configuration information "outward" for the
consumption of other Liveries.
2012-08-22 22:16:50 -07:00
R. Tyler Croy 18c64cbd5c Remove the notion of an "engine" since it's not any useful form of an abstraction
Fixes #49
2012-08-22 20:32:48 -07:00
R. Tyler Croy 5f44098e6a Finish up support for allocating and associating floating IPs for openstack blimps
Last night I was mistakenly using the image ID when trying to associate instead
of the server ID, so this fixes that. OpenStack wants a certain order of
operations for associating an IP as well, we must associate only after
OpenStack says the machine is ready.
2012-07-14 11:56:06 -07:00
R. Tyler Croy 54d86ac574 Clean-up the serialization and deserialization semantics for the .blimpy.d state files 2012-07-14 01:26:51 -07:00
R. Tyler Croy bc6a8bf307 Add support for predestroy/postdestroy hooks to allow OpenStack boxes to tear down their floating ip 2012-07-13 23:01:28 -07:00
R. Tyler Croy ee28537d16 Add some "prestart" and "poststart" support so OpenStack can allocate and associate an IP
This is the first half of the story, we need to make sure that the right
information is being persisted and then the second half can take place:
deassociating and releasing the floating IP
2012-07-13 22:24:06 -07:00
R. Tyler Croy 1e1e8ef759 Refactor some of the key importing code to work both on OpenStack and AWS 2012-07-13 21:45:11 -07:00
R. Tyler Croy 99e5a76242 Add experimental/hacky OpenStack support
Fixes #42
2012-07-13 17:16:13 -07:00
R. Tyler Croy b4fb195066 Add support for kick-starting machines via Blimpy's built-in scripts 2012-07-08 23:44:03 -07:00
R. Tyler Croy 739a3bb3d1 Handle falling back to tar+scp if the remote host lacks an rsync(1) binary
Fixes #40
2012-07-08 16:20:21 -07:00
R. Tyler Croy d3c8ea613f Don't perform the save on security group when we create it, not needed 2012-05-20 14:16:39 -07:00
R. Tyler Croy c777836df7 Automatically create security groups, ensuring that at the very least port 22 is opened
Fixes #11
2012-05-20 14:06:55 -07:00
R. Tyler Croy ac5a419142 Implement SecurityGroups#group_id to provide a consistent unique ID for security groups 2012-05-20 13:38:45 -07:00
R. Tyler Croy ebfedbe37d .Fix ssh commands now that #server is hidden on Box
Fixes #38
2012-05-20 11:52:45 -07:00
R. Tyler Croy 7b9098ef65 Refactor the creation of a Fog object out into its own method to help with creation/validation
Fixes #36
2012-05-19 15:54:22 -07:00
R. Tyler Croy d612a342ca Refactor the AWS validation to use the box's current @server for validation
Fixes #36
2012-05-19 15:39:25 -07:00
R. Tyler Croy 5548946759 Update the :cwd livery to use rsync instead of tarballs for pushing to the hosts 2012-05-19 12:13:45 -07:00
R. Tyler Croy 2420253da4 Persist the box type to the state file so we can reconstruct the correct class later 2012-05-19 11:32:21 -07:00
R. Tyler Croy 6cba71cfa8 iAdd the beginnings of an OpenStack box
This is going to be tricky to develop since I only have limited access to an
OpenStack cluster
2012-05-19 11:31:15 -07:00
R. Tyler Croy 6e661895e9 Move Box validation to be a box specific method 2012-05-18 15:29:31 -07:00
R. Tyler Croy bdac182237 Start pulling the AWS specific bits into Blimpy::Boxes::AWS 2012-05-18 15:09:11 -07:00
R. Tyler Croy 9055d7f8b7 Require all additions to a Fleet to specify the ship type (e.g. :aws)
This will make supporting more fog-backed types easier
2012-05-18 14:41:45 -07:00
R. Tyler Croy 2fa242c399 Fix this spec to properly run when a ~/.fog is not present
Fixes #26
2012-05-18 10:34:50 -07:00
R. Tyler Croy 48b3adb07d Add a simple, potentially stupid, `blimpy provision <name>` command to re-run the livery
This should speed up development of liveries for the time being

Fixes #22
2012-04-28 22:44:44 -07:00
R. Tyler Croy 8a313fe6a6 Only start bootstrapping a host once we're certain that it is online 2012-04-28 21:37:31 -07:00
R. Tyler Croy efe1c7230c Add woefully undertested support for a :cwd livery
There's plenty of haxx in here right now, not super certain how to properly
test this in any automated sense
2012-04-28 21:32:19 -07:00
R. Tyler Croy 4e0d26fb43 Add support for tarballing up directories to send along to the hosts 2012-04-28 21:23:00 -07:00
R. Tyler Croy 8934cf4417 Import id_rsa.pub into a blimpy specific keypair for every machine in every region
This commit also makes sure to set the security groups properly

Fixes #9
2012-04-28 14:06:05 -07:00
R. Tyler Croy 2792e161da Save the fleet id to the state directory's manifest file
Fixes #2
2012-04-28 12:48:26 -07:00
R. Tyler Croy 8e724b4952 Refactor some state file helper methods into a module to mix in 2012-04-28 12:33:39 -07:00
R. Tyler Croy 8ffcba76b3 Move specs into a directory to match the gem layout 2012-04-28 12:09:35 -07:00
R. Tyler Croy d0be53d601 Stub out print and puts for the fleet tests 2012-04-28 12:08:56 -07:00
R. Tyler Croy 00a68478b2 Add a mostly trite test for Box#from_instance_id
Overalll I think this method will need some serious refactoring in the future
2012-04-24 19:30:32 -07:00
R. Tyler Croy 14d3b8dfff Hide the Blimpy::Box @server instance variable
Fixes #??
2012-04-24 19:29:46 -07:00
R. Tyler Croy a5ce97a015 Support stopping and re-starting VMs
Fixes #5
Fixes #6
2012-04-23 20:13:28 -07:00
R. Tyler Croy f0aad89ad2 Properly support bringing Fog::Compute objects up with the appropriate regions
Fixes #4, #1
2012-04-23 18:35:52 -07:00
R. Tyler Croy 7a213da17e Actually test Blimpy::Box#stop 2012-04-22 23:07:03 -07:00
R. Tyler Croy d07c1d9da5 Add support for listing and destroying VMs that are already online 2012-04-22 22:49:50 -07:00
R. Tyler Croy ed9959bb3a Create the state file when a host is started 2012-04-22 22:11:41 -07:00
R. Tyler Croy 386b0bdf81 Test and implement Box#validate!
Mocking and testing Fog is hard as shit. Ouch
2012-04-22 15:39:20 -07:00
R. Tyler Croy 364c6fedb7 Use a more correct region mapping for EC2 2012-04-22 14:54:15 -07:00
R. Tyler Croy 137edcc389 Sufficiently far enough along to where parsing the Blimpfile creates the appropriate objects, YAY 2012-04-22 14:45:20 -07:00
R. Tyler Croy 40b8cae5b6 Fleshing out the Blimpy internals with tests, etc
Lots of this is still just "riffing" so to speak, not sure how things should be
composed entirely just yet
2012-04-22 14:35:29 -07:00