ops_tasks 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/ops_tasks/version.rb +1 -1
- data/lib/ops_tasks.rb +9 -3
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 91172316a6c53811207f53801dd574a9af26266f
|
4
|
+
data.tar.gz: 802fe0dfe412b1401b1db43fd71d2d85bc3fc40e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 633c1d6bd4ebad80d5abce986633b838a625b23418a7211cd7d5fff8c9140c72fe4af8f38fba377c1a542399d982586aa24d50f4a3ecf58a637e6c570b2cc13c
|
7
|
+
data.tar.gz: e420709e191b73ad21e5c6d21753ff63315f76d310c10bc4ace7ebf6aa2c7f37fa531f03a12b8da352d75117e7f2cdce7078265d6bb0a0c84e891dd027b441a6
|
data/lib/ops_tasks/version.rb
CHANGED
data/lib/ops_tasks.rb
CHANGED
@@ -7,7 +7,7 @@ module OpsTasks
|
|
7
7
|
def initialize(args)
|
8
8
|
if args.size > 0
|
9
9
|
@client = AWS::OpsWorks::Client.new
|
10
|
-
@
|
10
|
+
@layer_id = args[:layer_id]
|
11
11
|
@recipe = args[:recipe]
|
12
12
|
@stack_id = args[:stack_id]
|
13
13
|
@slack_channel = args[:room]
|
@@ -18,11 +18,17 @@ module OpsTasks
|
|
18
18
|
end
|
19
19
|
end
|
20
20
|
|
21
|
+
def instance_ids
|
22
|
+
client = AWS::OpsWorks::Client.new
|
23
|
+
instance_objects = client.describe_instances(:layer_id => @layer_id)
|
24
|
+
return instance_objects.instances.map{|i| i.instance_id}
|
25
|
+
end
|
26
|
+
|
21
27
|
def deploy
|
22
28
|
print "#{@project}: Preparing deployment... "
|
23
29
|
id = @client.create_deployment(
|
24
30
|
:stack_id => @stack_id,
|
25
|
-
:instance_ids =>
|
31
|
+
:instance_ids => instance_ids,
|
26
32
|
:command => {
|
27
33
|
name: "execute_recipes",
|
28
34
|
args: {"recipes" => [@recipe]}
|
@@ -37,7 +43,7 @@ module OpsTasks
|
|
37
43
|
|
38
44
|
id = @client.create_deployment(
|
39
45
|
:stack_id => @stack_id,
|
40
|
-
:instance_ids =>
|
46
|
+
:instance_ids => instance_ids,
|
41
47
|
:command => {name: 'update_custom_cookbooks'}
|
42
48
|
)[:deployment_id]
|
43
49
|
puts "successful"
|