awful 0.0.16 → 0.0.17

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: d86db7d836b9f87cbdef6d7d0fcb557d98a8c774
4
- data.tar.gz: 0720786aa239a62ad628f17f77b30e85b7415c6d
3
+ metadata.gz: b4d782409620eec745893663d7e44bb094b21cc8
4
+ data.tar.gz: 0d104de3eab159ce24bb5f5f65654312239a9d6e
5
5
  SHA512:
6
- metadata.gz: 4e5579d26928c00946f87b2d07cc014c174e62d6fb51aa656bd6ed9617893bb2342904ab169e02acee17e65809cbd92b0ad11c3f34ee154f29ec127492b764c7
7
- data.tar.gz: da0c1adfac59ce33d2d4e1499fba5cc2ae51115a71cc910dc8da892842334304096b8e5b8cf11da6ed4d2490c9c34924e2fa54e9916f244c2e5d4aaba497377b
6
+ metadata.gz: 5dc60b5d54103f20abdef43fb434c02ec109a63d9bc04800db1624e955c15de913cf3a622b3610d70fdf7f8f3bf713b0e21afd8007a7538a36165e7b1ebea89b
7
+ data.tar.gz: 9e3b1f3a1c96ada14657d2599f0e0a24dd2992c33dad750d99f4df6b87251198923d572e24d84f26615268284d7d70642df35cfab5bf5ce43d8a1cd000a7d7fd
@@ -69,13 +69,15 @@ module Awful
69
69
  end
70
70
 
71
71
  desc 'ssh NAME [ARGS]', 'ssh to an instance for this autoscaling group'
72
- method_option :all, aliases: '-a', default: false, desc: 'ssh to all instances'
73
- method_option :number, aliases: '-n', default: 1, desc: 'number of instances to ssh'
72
+ method_option :all, aliases: '-a', default: false, desc: 'ssh to all instances'
73
+ method_option :number, aliases: '-n', default: 1, desc: 'number of instances to ssh'
74
+ method_option :login_name, aliases: '-l', default: nil, desc: 'login name to pass to ssh'
74
75
  def ssh(name, *args)
75
76
  ips = ips(name).flatten
76
77
  num = options[:all] ? ips.count : options[:number].to_i
78
+ login_name = options[:login_name] ? "-l #{options[:login_name]}" : ''
77
79
  ips.last(num).each do |ip|
78
- system "ssh #{ip} #{Array(args).join(' ')}"
80
+ system "ssh #{login_name} #{ip} #{Array(args).join(' ')}"
79
81
  end
80
82
  end
81
83
 
@@ -218,6 +220,17 @@ module Awful
218
220
  end
219
221
  end
220
222
 
223
+ desc 'attach NAME INSTANCE_IDS', 'attach instances to auto-scaling group and increase desired capacity'
224
+ def attach(name, *instance_ids)
225
+ autoscaling.attach_instances(auto_scaling_group_name: name, instance_ids: instance_ids)
226
+ end
227
+
228
+ desc 'detach NAME INSTANCE_IDS', 'detach instances from auto-scaling group'
229
+ method_option :decrement, aliases: '-d', default: false, type: :boolean, desc: 'should decrement desired capacity'
230
+ def detach(name, *instance_ids)
231
+ autoscaling.detach_instances(auto_scaling_group_name: name, instance_ids: instance_ids, should_decrement_desired_capacity: options[:decrement])
232
+ end
233
+
221
234
  end
222
235
 
223
236
  end
@@ -1,3 +1,3 @@
1
1
  module Awful
2
- VERSION = "0.0.16"
2
+ VERSION = "0.0.17"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: awful
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.16
4
+ version: 0.0.17
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ric Lister
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-07-06 00:00:00.000000000 Z
11
+ date: 2015-07-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler