Commit ee7905c7 by James Cammarata

Compare include params against deprecated param names too

Fixes #12282
parent 950e067d
...@@ -54,6 +54,12 @@ class Base: ...@@ -54,6 +54,12 @@ class Base:
_environment = FieldAttribute(isa='list') _environment = FieldAttribute(isa='list')
_no_log = FieldAttribute(isa='bool') _no_log = FieldAttribute(isa='bool')
# param names which have been deprecated/removed
DEPRECATED_ATTRIBUTES = [
'sudo', 'sudo_user', 'sudo_pass', 'sudo_exe', 'sudo_flags',
'su', 'su_user', 'su_pass', 'su_exe', 'su_flags',
]
def __init__(self): def __init__(self):
# initialize the data loader and variable manager, which will be provided # initialize the data loader and variable manager, which will be provided
......
...@@ -192,7 +192,7 @@ class Task(Base, Conditional, Taggable, Become): ...@@ -192,7 +192,7 @@ class Task(Base, Conditional, Taggable, Become):
# top level of the task, so we move those into the 'vars' dictionary # top level of the task, so we move those into the 'vars' dictionary
# here, and show a deprecation message as we will remove this at # here, and show a deprecation message as we will remove this at
# some point in the future. # some point in the future.
if action == 'include' and k not in self._get_base_attributes(): if action == 'include' and k not in self._get_base_attributes() and k not in self.DEPRECATED_ATTRIBUTES:
self._display.deprecated("Specifying include variables at the top-level of the task is deprecated. Please see:\nhttp://docs.ansible.com/ansible/playbooks_roles.html#task-include-files-and-encouraging-reuse\n\nfor currently supported syntax regarding included files and variables") self._display.deprecated("Specifying include variables at the top-level of the task is deprecated. Please see:\nhttp://docs.ansible.com/ansible/playbooks_roles.html#task-include-files-and-encouraging-reuse\n\nfor currently supported syntax regarding included files and variables")
new_ds['vars'][k] = v new_ds['vars'][k] = v
else: else:
......
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