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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: e00dea07ed5aad5432d3f1188c9ec3e1804e2e06
4
- data.tar.gz: 99039a0c58892bc181e82cf27409c714bf151cb0
3
+ metadata.gz: 91172316a6c53811207f53801dd574a9af26266f
4
+ data.tar.gz: 802fe0dfe412b1401b1db43fd71d2d85bc3fc40e
5
5
  SHA512:
6
- metadata.gz: 60d83c5ab367b3886070f627539da689adb327c1dd003c3aa2ad23dbd9522645799e80b0849af8e0647fbd5ff533ab0c08e59f86e77ed86a895cff58ae349ace
7
- data.tar.gz: 9e6320641b341d36e6df169c27cb3fd2219dc63c3c11b2ef2972d2f68a4a83373d1843102a5a61d4c4d29ea46c09c776cb18e93614d4179f9728500f6329af86
6
+ metadata.gz: 633c1d6bd4ebad80d5abce986633b838a625b23418a7211cd7d5fff8c9140c72fe4af8f38fba377c1a542399d982586aa24d50f4a3ecf58a637e6c570b2cc13c
7
+ data.tar.gz: e420709e191b73ad21e5c6d21753ff63315f76d310c10bc4ace7ebf6aa2c7f37fa531f03a12b8da352d75117e7f2cdce7078265d6bb0a0c84e891dd027b441a6
@@ -1,3 +1,3 @@
1
1
  module OpsTasks
2
- VERSION = "0.1.0"
2
+ VERSION = "0.1.1"
3
3
  end
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
- @instance_ids = args[:layer_id].instances.map{|i| i.instance_id}
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 => @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 => [@instance_id],
46
+ :instance_ids => instance_ids,
41
47
  :command => {name: 'update_custom_cookbooks'}
42
48
  )[:deployment_id]
43
49
  puts "successful"
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ops_tasks
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nick Prokesch