Commit 709ffda3 by Michael DeHaan

Tweak only_if deprecation detector.

parent 25dc0ef8
...@@ -182,7 +182,7 @@ class Task(object): ...@@ -182,7 +182,7 @@ class Task(object):
# load various attributes # load various attributes
self.only_if = ds.get('only_if', 'True') 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") 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) self.when = ds.get('when', None)
......
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
vars_files: vars_files:
- common_vars.yml - common_vars.yml
- [ '$facter_operatingsystem.yml', 'default_os.yml' ] - [ '{{facter_operatingsystem.yml}}', 'default_os.yml' ]
tasks: tasks:
...@@ -25,10 +25,10 @@ ...@@ -25,10 +25,10 @@
action: command true action: command true
- name: test basic shell, plus two ways to dereference a variable - 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 - 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 # in the command below, the test file should contain a valid template
# and trigger the change handler # and trigger the change handler
...@@ -42,7 +42,7 @@ ...@@ -42,7 +42,7 @@
# not be triggered twice because it's already triggered # not be triggered twice because it's already triggered
- name: test template - 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: first_available_file:
- nonexistantfile - nonexistantfile
- sample.j2 - sample.j2
...@@ -60,7 +60,7 @@ ...@@ -60,7 +60,7 @@
# the following command should be skipped # the following command should be skipped
- name: this 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 when: 2 == 3
handlers: handlers:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment