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
709ffda3
Commit
709ffda3
authored
Oct 11, 2013
by
Michael DeHaan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Tweak only_if deprecation detector.
parent
25dc0ef8
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
6 deletions
+6
-6
lib/ansible/playbook/task.py
+1
-1
test/playbook1.yml
+5
-5
No files found.
lib/ansible/playbook/task.py
View file @
709ffda3
...
...
@@ -182,7 +182,7 @@ class Task(object):
# load various attributes
self
.
only_if
=
ds
.
get
(
'only_if'
,
'True'
)
if
self
.
only_if
!=
True
:
if
self
.
only_if
!=
'True'
:
utils
.
deprecated
(
"only_if is a very old feature and has been obsolete since 0.9, please switch to the 'when' conditional as described at http://ansibleworks.com/docs"
,
"1.5"
)
self
.
when
=
ds
.
get
(
'when'
,
None
)
...
...
test/playbook1.yml
View file @
709ffda3
...
...
@@ -14,7 +14,7 @@
vars_files
:
-
common_vars.yml
-
[
'
$facter_operatingsystem.yml
'
,
'
default_os.yml'
]
-
[
'
{{facter_operatingsystem.yml}}
'
,
'
default_os.yml'
]
tasks
:
...
...
@@ -25,10 +25,10 @@
action
:
command
true
-
name
:
test basic shell, plus two ways to dereference a variable
action
:
shell echo $HOME
$port
action
:
shell echo $HOME
{{port}}
-
name
:
test vars_files imports
action
:
shell echo
$duck $cow $testing
action
:
shell echo
{{duck}} {{cow}} {{testing}}
# in the command below, the test file should contain a valid template
# and trigger the change handler
...
...
@@ -42,7 +42,7 @@
# not be triggered twice because it's already triggered
-
name
:
test template
action
:
template src=
$item
dest=/tmp/ansible_test_data_template.out
action
:
template src=
{{item}}
dest=/tmp/ansible_test_data_template.out
first_available_file
:
-
nonexistantfile
-
sample.j2
...
...
@@ -60,7 +60,7 @@
# the following command should be skipped
-
name
:
this should be skipped
action
:
shell echo 'if you see this, this is wrong
($facter_operatingsystem)
'
action
:
shell echo 'if you see this, this is wrong'
when
:
2 == 3
handlers
:
...
...
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