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
c7c5b40a
Commit
c7c5b40a
authored
Jul 25, 2015
by
Brian Coca
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #11735 from mscherer/fix_10273
Document and test 'is undefined' rather than 'is not defined'
parents
b19eb0f4
106e942f
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
1 deletions
+11
-1
docsite/rst/playbooks_conditionals.rst
+1
-1
test/integration/roles/test_conditionals/tasks/main.yml
+10
-0
No files found.
docsite/rst/playbooks_conditionals.rst
View file @
c7c5b40a
...
@@ -90,7 +90,7 @@ If a required variable has not been set, you can skip or fail using Jinja2's
...
@@ -90,7 +90,7 @@ If a required variable has not been set, you can skip or fail using Jinja2's
when: foo is defined
when: foo is defined
- fail: msg="Bailing out. this play requires 'bar'"
- fail: msg="Bailing out. this play requires 'bar'"
when: bar is
not
defined
when: bar is
un
defined
This is especially useful in combination with the conditional import of vars
This is especially useful in combination with the conditional import of vars
files (see below).
files (see below).
...
...
test/integration/roles/test_conditionals/tasks/main.yml
View file @
c7c5b40a
...
@@ -148,6 +148,16 @@
...
@@ -148,6 +148,16 @@
that
:
that
:
-
"
result.skipped
==
true"
-
"
result.skipped
==
true"
-
name
:
test bad conditional 'is undefined'
shell
:
echo 'testing'
when
:
test_bare is undefined
register
:
result
-
name
:
assert bad conditional 'is undefined' did NOT run
assert
:
that
:
-
"
result.skipped
==
true"
-
name
:
test bare conditional
-
name
:
test bare conditional
shell
:
echo 'testing'
shell
:
echo 'testing'
when
:
test_bare
when
:
test_bare
...
...
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