Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
ansible
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
OpenEdx
ansible
Commits
dcde900e
Commit
dcde900e
authored
Aug 11, 2014
by
James Cammarata
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixing broken patch
20957a1b
Also adds integration tests for nested includes with conditionals
parent
d07107ab
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
14 additions
and
4 deletions
+14
-4
lib/ansible/playbook/play.py
+3
-4
test/integration/roles/test_good_parsing/tasks/main.yml
+8
-0
test/integration/roles/test_good_parsing/tasks/test_include_conditional.yml
+1
-0
test/integration/roles/test_good_parsing/tasks/test_include_nested.yml
+2
-0
No files found.
lib/ansible/playbook/play.py
View file @
dcde900e
...
...
@@ -538,11 +538,10 @@ class Play(object):
elif
k
.
startswith
(
"when_"
):
utils
.
deprecated
(
"
\"
when_<criteria>:
\"
is a removed deprecated feature, use the simplified 'when:' conditional directly"
,
None
,
removed
=
True
)
elif
k
==
'when'
:
if
type
(
x
[
k
])
is
str
:
included_additional_conditions
.
insert
(
0
,
x
[
k
])
if
isinstance
(
x
[
k
],
(
basestring
,
bool
))
:
included_additional_conditions
.
append
(
x
[
k
])
elif
type
(
x
[
k
])
is
list
:
for
i
in
x
[
k
]:
included_additional_conditions
.
insert
(
0
,
i
)
included_additional_conditions
.
extend
(
x
[
k
])
elif
k
in
(
"include"
,
"vars"
,
"default_vars"
,
"sudo"
,
"sudo_user"
,
"role_name"
,
"no_log"
):
continue
else
:
...
...
test/integration/roles/test_good_parsing/tasks/main.yml
View file @
dcde900e
...
...
@@ -164,3 +164,11 @@
-
result.invocation.module_name == "debug"
-
result.msg == "this should be debugged"
-
name
:
test conditional includes
include
:
test_include_conditional.yml
when
:
false
-
name
:
assert the nested include from test_include_conditional was not set
assert
:
that
:
-
nested_include_var is undefined
test/integration/roles/test_good_parsing/tasks/test_include_conditional.yml
0 → 100644
View file @
dcde900e
-
include
:
test_include_nested.yml
test/integration/roles/test_good_parsing/tasks/test_include_nested.yml
0 → 100644
View file @
dcde900e
-
name
:
set the nested include fact
set_fact
:
nested_include_var=1
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment