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 +4 -4
- data/lib/awful/auto_scaling.rb +16 -3
- data/lib/awful/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b4d782409620eec745893663d7e44bb094b21cc8
|
4
|
+
data.tar.gz: 0d104de3eab159ce24bb5f5f65654312239a9d6e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5dc60b5d54103f20abdef43fb434c02ec109a63d9bc04800db1624e955c15de913cf3a622b3610d70fdf7f8f3bf713b0e21afd8007a7538a36165e7b1ebea89b
|
7
|
+
data.tar.gz: 9e3b1f3a1c96ada14657d2599f0e0a24dd2992c33dad750d99f4df6b87251198923d572e24d84f26615268284d7d70642df35cfab5bf5ce43d8a1cd000a7d7fd
|
data/lib/awful/auto_scaling.rb
CHANGED
@@ -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,
|
73
|
-
method_option :number,
|
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
|
data/lib/awful/version.rb
CHANGED
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.
|
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-
|
11
|
+
date: 2015-07-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|