ansible-ruby 1.0.19 → 1.0.20

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: e04698b56584fd1caa14704fec7b793762bd6458
4
- data.tar.gz: 4b2bf0db0f8e82d7248f8e2e8ad979cc3a3a0f58
3
+ metadata.gz: ec5c2359bb0d0cba6b5ea5b285b38903320d2104
4
+ data.tar.gz: 928c1754d57d98e2b83c84a121e8f39a6336e9ea
5
5
  SHA512:
6
- metadata.gz: 1137688c63ee976e0277c812271ba2e04890787f87609fdb52e266a9ad05380fb4f2e2adde022f66932f84413ea4666c2e3b43cfed8ede1c27774f6c5bf85147
7
- data.tar.gz: 5b060edc927f419fabbe75ad1062a776619e64073c33bee98e0ecd03fef89a7af6d092120f11ef0e99c24617efc66324205e90b7ed11c01aa5917ee045108360
6
+ metadata.gz: ed95edfdc371508d36e424d636bb65b8e51e2d21853ddd4f1bef2d72289859cc9af032a5659b1a6c67c7517e36dfd647a1d71b4843a0d961a02f8437e4149d8b
7
+ data.tar.gz: 7a1dc5c6bc3fd8902504aaad23b1776f987642f5fc5e3fe6e9e3f3cd1be65084e8cbc3edc8e594bf95d807b1401d29de259ac9566965ab93e6ff5b0deaf78732
@@ -30,12 +30,19 @@ module Ansible
30
30
  @play_args[:roles] = value
31
31
  end
32
32
 
33
+ def tags(*value)
34
+ @play_args[:tags] = [*value]
35
+ end
36
+
33
37
  def role(name,
34
- tag = nil)
38
+ optional_stuff = {})
35
39
  roles = @play_args[:roles] ||= []
36
- roles << name unless tag
37
- # TODO: Roles should probably be a 'first class' model used within the play model
38
- roles << { role: name, tags: [*tag] } if tag
40
+ tag = optional_stuff[:tag] || optional_stuff[:tags]
41
+ our_role_result = { role: name }
42
+ our_role_result[:tags] = [*tag] if tag
43
+ ansible_when = optional_stuff[:when]
44
+ our_role_result[:when] = ansible_when if ansible_when
45
+ roles << our_role_result
39
46
  end
40
47
 
41
48
  def connection(value)
@@ -24,6 +24,7 @@ module Ansible
24
24
  attribute :tasks
25
25
  validates :tasks, type: Tasks
26
26
  attribute :roles
27
+ attribute :tags
27
28
  attribute :connection
28
29
  validates :connection,
29
30
  allow_nil: true,
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Ansible
4
4
  module Ruby
5
- VERSION = '1.0.19'
5
+ VERSION = '1.0.20'
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ansible-ruby
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.19
4
+ version: 1.0.20
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brady Wied
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-08-20 00:00:00.000000000 Z
11
+ date: 2019-08-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activemodel