-
Notifications
You must be signed in to change notification settings - Fork 24k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
'"include" is deprecated, use include_tasks/import_tasks instead.' deprecation warning is without link to place explaining how to deal with it #76684
Comments
My reading is that replacing all by |
This link is more specific I think: https://docs.ansible.com/ansible-core/2.12/user_guide/playbooks_reuse.html#re-using-files-and-roles |
It would also be useful to be able to see the files and line numbers where a deprecated "include" is still used. |
|
we try to keep the warnings generic so we can dedupe, otherwise the user would be flooded with warning messages if they have multiple includes in the play. Also easy to find them as @sivel has already pointed out ( |
And the right replacement is confusing (basically, import_tasks is pulled in at compile time, and include_tasks is dynamic - loaded at runtime): - ansible/ansible#76684 - https://serverfault.com/questions/875247/whats-the-difference-between-include-tasks-and-import-tasks - https://docs.ansible.com/ansible/latest/user_guide/playbooks_reuse.html#playbooks-reuse - https://docs.ansible.com/ansible/latest/user_guide/playbooks_reuse_includes.html
And the right replacement is confusing (basically, import_tasks is pulled in at compile time, and include_tasks is dynamic - loaded at runtime): - ansible/ansible#76684 - https://serverfault.com/questions/875247/whats-the-difference-between-include-tasks-and-import-tasks - https://docs.ansible.com/ansible/latest/user_guide/playbooks_reuse.html#playbooks-reuse - https://docs.ansible.com/ansible/latest/user_guide/playbooks_reuse_includes.html
Notes on how to include a link in an error message like this: Here's an example: https://github.com/ansible/ansible/blob/devel/lib/ansible/executor/interpreter_discovery.py#L130 - I n place of including a static URL when an error message is being built, use |
Actual file where this error message exists is - https://github.com/ansible/ansible/blob/devel/lib/ansible/playbook/helpers.py#L158 and the relative doclink is will need to add |
Summary
I noticed
Sadly, this deprecation warning is without link to documentation explaining how it should be fixed
I went to changelog: but https://github.com/ansible/ansible/blob/devel/changelogs/CHANGELOG.rst is not really helping with finding documentation
searching
import_tasks include_tasks difference ansible
on internet found finally https://serverfault.com/questions/875247/whats-the-difference-between-include-tasks-and-import-tasksEvery single person using Ansible will need to search for about 2 to 10 minutes - multiply it by number of Ansible users and there is quite big waste of time.
If there is a good reason to deprecate something - please link to documentation explaining how to fix code that worked fine so far.
Or maybe at least mention which version is equivalent to the current behaviour.
(ideally there would be
ansible undeprecate_include
which would edit all instances ofinclude
to whichever version is matching current one andansible undeprecate_include include_tasks
which would useinclude_tasks
andansible undeprecate_include import_tasks
)Issue Type
Documentation Report
Component Name
ansible (sorry)
Ansible Version
Configuration
OS / Environment
Lubuntu 20.04
Additional Information
No googling needed to find docs, lower risk of finding misleading docs
Code of Conduct
The text was updated successfully, but these errors were encountered: