Remove deprecated include vartags usage (#74780)
* Add clog frag * Remove ignore
This commit is contained in:
parent
71e33d2578
commit
bc48eba896
3 changed files with 3 additions and 15 deletions
3
changelogs/fragments/74144-remove-include-vartags.yml
Normal file
3
changelogs/fragments/74144-remove-include-vartags.yml
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
bugfixes:
|
||||||
|
- includes - Remove the deprecated ability to specify ``tags`` as ``vars`` on includes
|
||||||
|
(https://github.com/ansible/ansible/issues/74144)
|
|
@ -922,20 +922,6 @@ class StrategyBase:
|
||||||
raise AnsibleError("included task files must contain a list of tasks")
|
raise AnsibleError("included task files must contain a list of tasks")
|
||||||
|
|
||||||
ti_copy = self._copy_included_file(included_file)
|
ti_copy = self._copy_included_file(included_file)
|
||||||
# pop tags out of the include args, if they were specified there, and assign
|
|
||||||
# them to the include. If the include already had tags specified, we raise an
|
|
||||||
# error so that users know not to specify them both ways
|
|
||||||
tags = included_file._task.vars.pop('tags', [])
|
|
||||||
if isinstance(tags, string_types):
|
|
||||||
tags = tags.split(',')
|
|
||||||
if len(tags) > 0:
|
|
||||||
if len(included_file._task.tags) > 0:
|
|
||||||
raise AnsibleParserError("Include tasks should not specify tags in more than one way (both via args and directly on the task). "
|
|
||||||
"Mixing tag specify styles is prohibited for whole import hierarchy, not only for single import statement",
|
|
||||||
obj=included_file._task._ds)
|
|
||||||
display.deprecated("You should not specify tags in the include parameters. All tags should be specified using the task-level option",
|
|
||||||
version='2.12', collection_name='ansible.builtin')
|
|
||||||
included_file._task.tags = tags
|
|
||||||
|
|
||||||
block_list = load_list_of_blocks(
|
block_list = load_list_of_blocks(
|
||||||
data,
|
data,
|
||||||
|
|
|
@ -123,7 +123,6 @@ lib/ansible/plugins/action/normal.py action-plugin-docs # default action plugin
|
||||||
lib/ansible/plugins/cache/base.py ansible-doc!skip # not a plugin, but a stub for backwards compatibility
|
lib/ansible/plugins/cache/base.py ansible-doc!skip # not a plugin, but a stub for backwards compatibility
|
||||||
lib/ansible/plugins/inventory/script.py pylint:ansible-deprecated-version
|
lib/ansible/plugins/inventory/script.py pylint:ansible-deprecated-version
|
||||||
lib/ansible/plugins/lookup/sequence.py pylint:blacklisted-name
|
lib/ansible/plugins/lookup/sequence.py pylint:blacklisted-name
|
||||||
lib/ansible/plugins/strategy/__init__.py pylint:ansible-deprecated-version
|
|
||||||
lib/ansible/plugins/strategy/__init__.py pylint:blacklisted-name
|
lib/ansible/plugins/strategy/__init__.py pylint:blacklisted-name
|
||||||
lib/ansible/plugins/strategy/linear.py pylint:blacklisted-name
|
lib/ansible/plugins/strategy/linear.py pylint:blacklisted-name
|
||||||
lib/ansible/vars/hostvars.py pylint:blacklisted-name
|
lib/ansible/vars/hostvars.py pylint:blacklisted-name
|
||||||
|
|
Loading…
Reference in a new issue