add link to deprecation warning (#77599)

* add link to deprecation warning

(cherry picked from commit f991470dd0)
pull/77635/head
Sandra McCann 3 years ago committed by GitHub
parent 578a815271
commit 1802684c7b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -0,0 +1,2 @@
bugfixes:
- include module - add docs url to include deprecation message (https://github.com/ansible/ansible/issues/76684).

@ -95,6 +95,7 @@ def load_list_of_tasks(ds, play, block=None, role=None, task_include=None, use_h
from ansible.playbook.role_include import IncludeRole
from ansible.playbook.handler_task_include import HandlerTaskInclude
from ansible.template import Templar
from ansible.utils.plugin_docs import get_versioned_doclink
if not isinstance(ds, list):
raise AnsibleAssertionError('The ds (%s) should be a list but was a %s' % (ds, type(ds)))
@ -155,7 +156,8 @@ def load_list_of_tasks(ds, play, block=None, role=None, task_include=None, use_h
elif action in C._ACTION_IMPORT_TASKS:
is_static = True
else:
display.deprecated('"include" is deprecated, use include_tasks/import_tasks instead', "2.16")
include_link = get_versioned_doclink('user_guide/playbooks_reuse_includes.html')
display.deprecated('"include" is deprecated, use include_tasks/import_tasks instead. See %s for details' % include_link, "2.16")
is_static = not templar.is_template(t.args['_raw_params']) and t.all_parents_static() and not t.loop
if is_static:

Loading…
Cancel
Save