Commit Graph

125 Commits

Author SHA1 Message Date
Kohsuke Kawaguchi 14ff83390e Don't force port 22 if the port is not set.
In this way ~/.ssh/config can take effect
2013-09-27 09:48:12 -07:00
Ryan Campbell 2caf7508ee Only import the keypair if it doesn't exist 2013-08-15 15:36:53 -07:00
Kohsuke Kawaguchi 3fea6848ce differentiating host and name as host can contain dots and other possibly nasty characters 2013-07-03 16:19:27 -07:00
Kohsuke Kawaguchi 45fd43107c Added a new box type 'existing'
This box type is useful for controlling existing non-cloud machines
under blimpy
2013-07-02 21:22:04 -07:00
R. Tyler Croy 4f4bc39850 Expose the resume functionality through a specific CLI command
Fixes #57
2013-06-30 20:55:36 -07:00
R. Tyler Croy 302e0ea555 Sanitize hostnames for keypairs
Fixes #76
2013-06-30 20:44:07 -07:00
R. Tyler Croy 613cae868f Bump the version for another release, woo 2013-05-17 14:30:36 -07:00
Jeff Blaine 5535fc09c6 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.
2013-04-25 22:11:53 +00:00
Jeff Blaine 8494a4b66b Intro the show command for future details (tags for now) 2013-04-25 22:04:57 +00:00
Kohsuke Kawaguchi c3fe15ff2c Revisiting 8b3800894c
(04:25:26 PM) rtyler: kohsuke: so `blimpy ssh` is going to return immediately now?
(04:25:41 PM) kohsuke: yes, it fails if ssh fails
(04:26:09 PM) ***rtyler is a bit confused
(04:26:14 PM) rtyler: this seems like a big UX change then
(04:26:21 PM) ***rtyler should read more carefully
(04:27:13 PM) kohsuke: Yes, modifying a test case made me wonder if there's a better way to do it
(04:28:00 PM) kohsuke: (though in practice you wouldn't see any change as "blimpy provision" does wait for ssh to come online)
(04:28:13 PM) rtyler: but a `blimpy ssh` won't log me into the machine?
(04:28:51 PM) kohsuke: I think just reporting ">> Connecting: SHIPNAME..." if the first attempt fails would be sufficient
(04:29:25 PM) kohsuke: The "gotcha" that made me write that patch is that my first attempt to use blimpy failed miserably at "blimpy ssh"
(04:29:51 PM) kohsuke: because it was trying a wrong user name, and I couldn't Ctrl+C it because of another bug that since then I fixed
(04:30:11 PM) rtyler: with aws and openstack it connects multiple times, usually the machine isn't accepting ssh connections right away
(04:30:14 PM) rtyler: especially on a fresh image
(04:30:25 PM) kohsuke: yes, I understand why you wrote it the way you did the first place
(04:31:17 PM) rtyler: heh
(04:31:21 PM) rtyler: alright
(04:32:05 PM) kohsuke: Let me change it to ">> Connecting: user@SHIPNAME:port" with dots added over time,
(04:32:15 PM) kohsuke: and if it's killed by SIGINT I'll run ssh one last time but without -q
(04:32:22 PM) kohsuke: so you see the error message
(04:32:41 PM) kohsuke: does that sound OK to you?
(04:34:30 PM) rtyler: that does sound good

It turns out some mode of failure includes ssh hanging (such as trying a
wrong port), so silently re-running SSH again wasn't very wise. Instead,
show the command line needed to let the user run the ssh command by
himself.
2013-03-29 16:59:43 -07:00
Kohsuke Kawaguchi a62c24afe2 If Blimpfile is invalid, report why 2013-03-29 16:15:41 -07:00
Kohsuke Kawaguchi cd1ebc211d Making it work again with fog 1.10
in 1.9, the original code was sufficient, but 1.10 has a massive
refactoring in the way of registering providers. Unless at least one
provider is registered, the providers hash is empty, and it causes
an exception like the following:

/var/lib/gems/1.8/gems/fog-1.10.0/lib/fog/compute.rb:39:in `new': undefined method `include?' for nil:NilClass (NoMethodError)
    from /home/kohsuke/ws/cloudbees/blimpy/lib/blimpy/boxes/aws.rb:39:in `fog'
    from /home/kohsuke/ws/cloudbees/blimpy/lib/blimpy/boxes/aws.rb:32:in `validate!'
    from /home/kohsuke/ws/cloudbees/blimpy/lib/blimpy/fleet.rb:110:in `start'
    from /home/kohsuke/ws/cloudbees/blimpy/lib/blimpy/fleet.rb:109:in `each'
    from /home/kohsuke/ws/cloudbees/blimpy/lib/blimpy/fleet.rb:109:in `start'
    from /home/kohsuke/ws/cloudbees/blimpy/lib/blimpy/cli.rb:73:in `start'
    from /var/lib/gems/1.8/gems/thor-0.18.0/lib/thor/command.rb:27:in `__send__'
    from /var/lib/gems/1.8/gems/thor-0.18.0/lib/thor/command.rb:27:in `run'
    from /var/lib/gems/1.8/gems/thor-0.18.0/lib/thor/invocation.rb:120:in `invoke_command'
    from /var/lib/gems/1.8/gems/thor-0.18.0/lib/thor.rb:363:in `dispatch'
    from /var/lib/gems/1.8/gems/thor-0.18.0/lib/thor/base.rb:427:in `start'
    from /home/kohsuke/ws/cloudbees/blimpy/bin/blimpy:24

By forcing the registration of a provider, it works against with fog
1.10. Looking at the source tree, this change should also work with fog
1.9.
2013-03-29 16:13:37 -07:00
Kohsuke Kawaguchi de4830fc40 SSH returns 255 for connection refused errors.
So limiting the range down a bit.
2013-03-29 15:46:17 -07:00
Kohsuke Kawaguchi 1ef4ad00a5 Adding multi-file scp 2013-03-29 14:50:46 -07:00
Kohsuke Kawaguchi 43a9bcf78c support a non-standard SSH port 2013-03-27 18:32:33 -07:00
Kohsuke Kawaguchi 04993ecb19 don't waste a line if there's no need to
Blimpy prints unnecessary empty line if the SSH connection goes through
fast enough. Don't do it.
2013-03-26 14:23:12 -07:00
Kohsuke Kawaguchi 462416616b function like this touching ARGV is abstraction violation, as it prevents other driver code from legitimately launching interactive shell.
Better to let the calling command handle this
2013-03-26 14:21:28 -07:00
Kohsuke Kawaguchi 8b3800894c Forcing ssh_wait is considered harmful.
1. If your Blimpfile is misconfigured, you'll not get any diagnostics information.
2. When you press Ctrl+C, blimpy doesn't exit because it's just ssh getting killed (and blimp ignores that)

There appears to be no provision for handling options, so I just made it a separate command
2013-03-26 14:21:28 -07:00
Jeff Blaine a0e05662ee Serialize :tags to state file
Should be harmless, and I'm looking to use it.
2013-02-06 20:46:24 +00:00
R. Tyler Croy c5aaab604e Merge pull request #66 from jblaine/patch-2
Expose box.name as environ var. to script
2012-12-29 13:02:28 -08:00
Jeff Blaine d2a040a285 Show internal DNS as well for status 2012-12-27 15:40:21 -05:00
Jeff Blaine 1f6b038abf Expose box.name as environ var. to script
Allows script to perform logic based on BLIMPY_SHIPNAME
2012-12-27 10:59:21 -05:00
R. Tyler Croy 420b878f8b Fix a minor shell issue with the Puppet livery.
This will fail trying to chmod the entire puppet command string

    chmod: unrecognized option '--modulepath=./modules'
    Try `chmod --help' for more information.
2012-12-18 21:38:33 -08:00
R. Tyler Croy fe2d2856df Version bump for a relase with jblaine's RHEL fixes 2012-12-12 09:48:33 -08:00
Jeff Blaine 6853b1ba5a Ensure gempath.sh and livery command are executable 2012-12-12 12:01:33 -05:00
R. Tyler Croy 7c0745e33a Force the Puppet livery to install a 2.7 version by default instead of 3.0 2012-10-15 21:52:02 -07:00
R. Tyler Croy 17d3a1f3bf Bump the version for the security groups fix 2012-10-03 17:08:02 -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 009dc45649 Move the use of global args into the CLI layer instead of the Box#scp_file API
Fixes #53
2012-09-03 12:04:45 -07:00
R. Tyler Croy ca76d1667b Version bump 2012-09-03 11:35:14 -07:00
R. Tyler Croy 2d7bd1ffcc If the .blimpignore file exists, use it for the rsync
Fixes #39
2012-09-03 11:34:42 -07:00
R. Tyler Croy 992ab91bb3 Add a Box#provision method to make using Blimpy as an API clearer 2012-09-03 11:10:20 -07:00
R. Tyler Croy e429153bf3 Bump the gem version for a release 2012-08-26 17:32:55 -07:00
R. Tyler Croy 252486454a Add a helper script to pull in the appropriate path on Debian-based hosts for invoking the Puppet binary provided by the gem 2012-08-26 17:31:42 -07:00
R. Tyler Croy 2edecb46ec Add a minor optimization, don't bother bootstrapping Puppet if it's already in our PATH 2012-08-25 14:25:37 -07:00
R. Tyler Croy edcc292686 Clean-up the remainder of the holes missed when refactoring for the Puppet livery 2012-08-25 14:19:02 -07:00
R. Tyler Croy ed5464ff39 Move can_rsync? into the base livery class where it belongs 2012-08-25 14:18:55 -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 0ef273359b Change the default AMI ID to an Ubuntu 12.04 LTS (amd64) image 2012-08-22 22:20:56 -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 8964005338 Bump to version to 0.6 so I can break some more things 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 cd00c74425 Add a simple "version" task to print the current version of the gem 2012-08-21 20:14:55 -07:00
R. Tyler Croy f8635943b4 Bump the version for a bugfix release 2012-08-19 17:38:46 -07:00
Branan Purvine-Riley 22d616eabc Fix instance_data lookups to use symbols 2012-08-15 10:45:00 -07:00
R. Tyler Croy b1ccfc8780 Make the "name" argument to `blimpy ssh` optional, if it's not provided we'll choose the first ship we find 2012-08-10 17:06:30 -07:00
R. Tyler Croy 88e7dd3bdf Jump to 0.5.0 for the new livery changes 2012-08-10 16:32:27 -07:00
R. Tyler Croy 63c22a64d8 Bump for a new release 2012-08-10 14:26:03 -07:00
R. Tyler Croy eede1a94cb Ignore host key checks when rsyncing things to the machine
Fixes #43
2012-07-20 17:13:22 -07:00
R. Tyler Croy 509aba05c8 Properly load the box_by_name when provisioning without an explicit name 2012-07-20 15:16:38 -07:00