caterer 0.3.1 → 0.4.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -16,6 +16,9 @@ module Caterer
16
16
  opts.on('-p PASSWORD', '--password PASSWORD', 'assumes key') do |p|
17
17
  options[:pass] = p
18
18
  end
19
+ opts.on('-k KEY', '--key KEY', 'path to private key') do |k|
20
+ options[:key] = k
21
+ end
19
22
  opts.on('-P PORT', '--port PORT', 'assumes 22') do |p|
20
23
  options[:port] = p
21
24
  end
@@ -91,6 +94,7 @@ module Caterer
91
94
  opts[:host] = member.host || options[:host]
92
95
  opts[:port] = options[:port] || member.port
93
96
  opts[:images] = image_list(options) || member.images || group.images
97
+ opts[:key] = options[:key] || member.key || group.key
94
98
 
95
99
  opts[:data] = begin
96
100
  data = nil
@@ -3,7 +3,7 @@ module Caterer
3
3
  class Group
4
4
 
5
5
  attr_reader :name
6
- attr_accessor :images, :members, :user, :password, :data
6
+ attr_accessor :images, :members, :user, :password, :key, :data
7
7
 
8
8
  def initialize(name=nil)
9
9
  @name = name
@@ -3,7 +3,7 @@ module Caterer
3
3
  class Member
4
4
 
5
5
  attr_reader :name
6
- attr_accessor :host, :port, :user, :password, :images, :data
6
+ attr_accessor :host, :port, :user, :password, :key, :images, :data
7
7
 
8
8
  def initialize(name=nil)
9
9
  @name = name
@@ -201,7 +201,7 @@ module Caterer
201
201
  end
202
202
 
203
203
  def config_data
204
- config.json.merge(server.data).merge({:run_list => config.run_list})
204
+ {:run_list => config.run_list}.merge(config.json).merge(server.data)
205
205
  end
206
206
 
207
207
  def json_config_path
@@ -12,6 +12,7 @@ module Caterer
12
12
  @pass = opts[:pass]
13
13
  @host = opts[:host]
14
14
  @port = opts[:port]
15
+ @key = opts[:key]
15
16
  @images = opts[:images] || []
16
17
  @data = opts[:data] || {}
17
18
  end
@@ -63,10 +64,12 @@ module Caterer
63
64
  end
64
65
 
65
66
  def ssh_opts
66
- {
67
- :port => port,
68
- :password => password
69
- }
67
+ {}.tap do |opts|
68
+ opts[:paranoid] = false
69
+ opts[:port] = port
70
+ opts[:password] = password if password
71
+ opts[:keys] = ["#{@key}"] if @key
72
+ end
70
73
  end
71
74
 
72
75
  def ui
@@ -1,3 +1,3 @@
1
1
  module Caterer
2
- VERSION = "0.3.1"
2
+ VERSION = "0.4.0"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: caterer
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.1
4
+ version: 0.4.0
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-12-21 00:00:00.000000000 Z
12
+ date: 2012-12-22 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: log4r