ansible_spec 0.2.17 → 0.2.18
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +3 -0
- data/lib/ansible_spec/load_ansible.rb +2 -2
- data/lib/ansible_spec/version.rb +1 -1
- data/lib/src/Rakefile +7 -2
- data/spec/dependency_spec.rb +23 -0
- 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: ab3d19e55721a01afceeab9daea2095ecf7db535
|
4
|
+
data.tar.gz: 8ff233d19dd55ea99e7e42a312f9332d7e0afa9d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0cbb81807e2721fb1d241e9aeb4b1f642ecac773c5a334abe1f7f343b2344cd1f50b9c95bfc8d02091c1f6b02398ff8e4bf9483dd602b629a32bba664ba6ee1d
|
7
|
+
data.tar.gz: 0d33e6b56cd6968726e37203ff53d62b49ca03cb4e447acbae03c0394a1a88226a96846e929cf4062c7b96a8a6d2c2f0b5744ce80b2521cbae4d8b0c1ddd6cc4
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,6 @@
|
|
1
|
+
# v0.2.18
|
2
|
+
- Merge [#96 Handle roles_path for role dependencies as well](https://github.com/volanja/ansible_spec/pull/96) by [agx](https://github.com/agx)
|
3
|
+
|
1
4
|
# v0.2.17
|
2
5
|
- Merge [#90 Check if all array elements have a name](https://github.com/volanja/ansible_spec/pull/90) by [agx](https://github.com/agx)
|
3
6
|
- Merge [#91 Parse roledirs from ansible.cfg](https://github.com/volanja/ansible_spec/pull/91) by [agx](https://github.com/agx)
|
@@ -196,12 +196,12 @@ module AnsibleSpec
|
|
196
196
|
|
197
197
|
# param: role
|
198
198
|
# return: ["role1", "role2"]
|
199
|
-
def self.load_dependencies(role)
|
199
|
+
def self.load_dependencies(role, rolepath='roles')
|
200
200
|
role_queue = [role]
|
201
201
|
deps = []
|
202
202
|
until role_queue.empty?
|
203
203
|
role = role_queue.pop()
|
204
|
-
path = File.join(
|
204
|
+
path = File.join(rolepath, role, "meta", "main.yml")
|
205
205
|
|
206
206
|
if File.exist?(path)
|
207
207
|
dependencies = YAML.load_file(path).fetch("dependencies", [])
|
data/lib/ansible_spec/version.rb
CHANGED
data/lib/src/Rakefile
CHANGED
@@ -34,8 +34,13 @@ namespace :serverspec do
|
|
34
34
|
|
35
35
|
roles = property["roles"]
|
36
36
|
for role in property["roles"]
|
37
|
-
|
38
|
-
|
37
|
+
for rolepath in cfg.roles_path
|
38
|
+
deps = AnsibleSpec.load_dependencies(role, rolepath)
|
39
|
+
if deps != []
|
40
|
+
roles += deps
|
41
|
+
break
|
42
|
+
end
|
43
|
+
end
|
39
44
|
end
|
40
45
|
t.pattern = '{' + cfg.roles_path.join(',') + '}/{' + roles.join(',') + '}/spec/*_spec.rb'
|
41
46
|
end
|
data/spec/dependency_spec.rb
CHANGED
@@ -87,3 +87,26 @@ EOF
|
|
87
87
|
File.delete(tmp_webapp_meta)
|
88
88
|
end
|
89
89
|
end
|
90
|
+
|
91
|
+
describe "load_dependencies from alternative dir" do
|
92
|
+
tmp_webapp_meta = 'more_roles/webapp/meta/main.yml'
|
93
|
+
|
94
|
+
webapp_meta_content = <<'EOF'
|
95
|
+
---
|
96
|
+
dependencies:
|
97
|
+
- foo
|
98
|
+
EOF
|
99
|
+
|
100
|
+
before do
|
101
|
+
create_file(tmp_webapp_meta, webapp_meta_content)
|
102
|
+
@deps = AnsibleSpec.load_dependencies("webapp", "more_roles")
|
103
|
+
end
|
104
|
+
|
105
|
+
it 'should correctly resolve deps in additional role dirs' do
|
106
|
+
expect(@deps).to eq ["foo"]
|
107
|
+
end
|
108
|
+
|
109
|
+
after do
|
110
|
+
File.delete(tmp_webapp_meta)
|
111
|
+
end
|
112
|
+
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ansible_spec
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.18
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- volanja
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-
|
11
|
+
date: 2017-02-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|