sprinkle 0.6.0 → 0.6.1

Sign up to get free protection for your applications and to get access to all the features.
data/CHANGELOG.md CHANGED
@@ -1,3 +1,7 @@
1
+ * Add support for specifying the Net::SSH keys property
2
+
3
+ *Chris Kimpton*
4
+
1
5
  * push_text was escaping & and / when it should not be
2
6
 
3
7
  *Stefano Diem Benatti*
@@ -16,6 +16,18 @@ module Sprinkle
16
16
  # end
17
17
  #
18
18
  #
19
+ # == Use ssh key file
20
+ #
21
+ # deployment do
22
+ # delivery :ssh do
23
+ # user "sprinkle"
24
+ # keys "/path/to/ssh/key/file" # passed directly to Net::SSH as :keys option
25
+ #
26
+ # role :app, "app.myserver.com"
27
+ # end
28
+ # end
29
+ #
30
+ #
19
31
  # == Working thru a gateway
20
32
  #
21
33
  # If you're behind a firewall and need to use a SSH gateway that's fine.
@@ -87,6 +99,10 @@ module Sprinkle
87
99
  @options[:password] = password
88
100
  end
89
101
 
102
+ def keys(keys)
103
+ @options[:keys] = keys
104
+ end
105
+
90
106
  # Set this to true to prepend 'sudo' to every command.
91
107
  def use_sudo(value=true)
92
108
  @options[:use_sudo] = value
@@ -175,7 +191,7 @@ module Sprinkle
175
191
  if res != 0
176
192
  fail=SSHCommandFailure.new
177
193
  fail.details = @log_recorder.hash.merge(:hosts => host)
178
- raise fail, "#{cmd} failed with error code #{res[:code]}"
194
+ raise fail
179
195
  end
180
196
  end
181
197
  true
@@ -243,7 +259,7 @@ module Sprinkle
243
259
  if @gateway
244
260
  gateway.ssh(host, @options[:user])
245
261
  else
246
- @connection_cache.start(host, @options[:user],:password => @options[:password])
262
+ @connection_cache.start(host, @options[:user],:password => @options[:password], :keys => @options[:keys])
247
263
  end
248
264
  end
249
265
 
@@ -38,7 +38,7 @@ module Sprinkle
38
38
  protected
39
39
 
40
40
  def install_commands #:nodoc:
41
- noninteractive = "--gecos ,,,"
41
+ noninteractive = " --gecos ,,,"
42
42
  flags = @options[:flags] || ""
43
43
  flags << noninteractive unless flags =~ /--gecos/
44
44
  "adduser #{flags} #{@username}"
@@ -30,6 +30,7 @@ module Sprinkle
30
30
  else
31
31
  @commands << "[ -n \"`echo \\`which #{path}\\``\" ]"
32
32
  end
33
+ @commands << "which #{path}"
33
34
  end
34
35
 
35
36
  # Same as has_executable but with checking for e certain version number.
@@ -1,3 +1,3 @@
1
1
  module Sprinkle
2
- Version = "0.6.0"
2
+ Version = "0.6.1"
3
3
  end
@@ -16,7 +16,13 @@ describe Sprinkle::Installers::User do
16
16
  it "should invoke add user" do
17
17
  @installer = create_user 'bob'
18
18
  @install_commands = @installer.send :install_commands
19
- @install_commands.should == "adduser --gecos ,,, bob"
19
+ @install_commands.should == "adduser --gecos ,,, bob"
20
+ end
21
+
22
+ it "should merge flags" do
23
+ @installer = create_user 'bob', :flags => "-x"
24
+ @install_commands = @installer.send :install_commands
25
+ @install_commands.should == "adduser -x --gecos ,,, bob"
20
26
  end
21
27
 
22
28
  it "should use actual gecos options if passed" do
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sprinkle
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.0
4
+ version: 0.6.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2013-05-27 00:00:00.000000000 Z
13
+ date: 2013-05-28 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: rspec