mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-07-25 06:10:22 -07:00
Bump deprecation for include to 2.12 (#44230)
This commit is contained in:
parent
4c62722675
commit
0beaea22a4
2 changed files with 6 additions and 6 deletions
|
@ -159,7 +159,7 @@ def load_list_of_tasks(ds, play, block=None, role=None, task_include=None, use_h
|
||||||
is_static = True
|
is_static = True
|
||||||
elif t.static is not None:
|
elif t.static is not None:
|
||||||
display.deprecated("The use of 'static' has been deprecated. "
|
display.deprecated("The use of 'static' has been deprecated. "
|
||||||
"Use 'import_tasks' for static inclusion, or 'include_tasks' for dynamic inclusion")
|
"Use 'import_tasks' for static inclusion, or 'include_tasks' for dynamic inclusion", version='2.12')
|
||||||
is_static = t.static
|
is_static = t.static
|
||||||
else:
|
else:
|
||||||
is_static = C.DEFAULT_TASK_INCLUDES_STATIC or \
|
is_static = C.DEFAULT_TASK_INCLUDES_STATIC or \
|
||||||
|
@ -260,7 +260,7 @@ def load_list_of_tasks(ds, play, block=None, role=None, task_include=None, use_h
|
||||||
"later. In the future, this will be an error unless 'static: no' is used "
|
"later. In the future, this will be an error unless 'static: no' is used "
|
||||||
"on the include task. If you do not want missing includes to be considered "
|
"on the include task. If you do not want missing includes to be considered "
|
||||||
"dynamic, use 'static: yes' on the include or set the global ansible.cfg "
|
"dynamic, use 'static: yes' on the include or set the global ansible.cfg "
|
||||||
"options to make all includes static for tasks and/or handlers" % include_file, version="2.7"
|
"options to make all includes static for tasks and/or handlers" % include_file, version="2.12"
|
||||||
)
|
)
|
||||||
task_list.append(t)
|
task_list.append(t)
|
||||||
continue
|
continue
|
||||||
|
@ -297,7 +297,7 @@ def load_list_of_tasks(ds, play, block=None, role=None, task_include=None, use_h
|
||||||
suppress_extended_error=True,
|
suppress_extended_error=True,
|
||||||
)
|
)
|
||||||
display.deprecated("You should not specify tags in the include parameters. All tags should be specified using the task-level option",
|
display.deprecated("You should not specify tags in the include parameters. All tags should be specified using the task-level option",
|
||||||
version="2.7")
|
version="2.12")
|
||||||
else:
|
else:
|
||||||
tags = ti_copy.tags[:]
|
tags = ti_copy.tags[:]
|
||||||
|
|
||||||
|
@ -335,7 +335,7 @@ def load_list_of_tasks(ds, play, block=None, role=None, task_include=None, use_h
|
||||||
|
|
||||||
elif ir.static is not None:
|
elif ir.static is not None:
|
||||||
display.deprecated("The use of 'static' for 'include_role' has been deprecated. "
|
display.deprecated("The use of 'static' for 'include_role' has been deprecated. "
|
||||||
"Use 'import_role' for static inclusion, or 'include_role' for dynamic inclusion")
|
"Use 'import_role' for static inclusion, or 'include_role' for dynamic inclusion", version='2.12')
|
||||||
is_static = ir.static
|
is_static = ir.static
|
||||||
|
|
||||||
if is_static:
|
if is_static:
|
||||||
|
|
|
@ -226,10 +226,10 @@ class Task(Base, Conditional, Taggable, Become):
|
||||||
# pre-2.0 syntax allowed variables for include statements at the top level of the task,
|
# pre-2.0 syntax allowed variables for include statements at the top level of the task,
|
||||||
# so we move those into the 'vars' dictionary here, and show a deprecation message
|
# so we move those into the 'vars' dictionary here, and show a deprecation message
|
||||||
# as we will remove this at some point in the future.
|
# as we will remove this at some point in the future.
|
||||||
if action in ('include', 'include_tasks') and k not in self._valid_attrs and k not in self.DEPRECATED_ATTRIBUTES:
|
if action in ('include',) and k not in self._valid_attrs and k not in self.DEPRECATED_ATTRIBUTES:
|
||||||
display.deprecated("Specifying include variables at the top-level of the task is deprecated."
|
display.deprecated("Specifying include variables at the top-level of the task is deprecated."
|
||||||
" Please see:\nhttps://docs.ansible.com/ansible/playbooks_roles.html#task-include-files-and-encouraging-reuse\n\n"
|
" Please see:\nhttps://docs.ansible.com/ansible/playbooks_roles.html#task-include-files-and-encouraging-reuse\n\n"
|
||||||
" for currently supported syntax regarding included files and variables", version="2.7")
|
" for currently supported syntax regarding included files and variables", version="2.12")
|
||||||
new_ds['vars'][k] = v
|
new_ds['vars'][k] = v
|
||||||
elif C.INVALID_TASK_ATTRIBUTE_FAILED or k in self._valid_attrs:
|
elif C.INVALID_TASK_ATTRIBUTE_FAILED or k in self._valid_attrs:
|
||||||
new_ds[k] = v
|
new_ds[k] = v
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue