-
Notifications
You must be signed in to change notification settings - Fork 23.8k
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
docs: Clarify include_task v import_tasks with conditionals #43856
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for improving the docs. I've noted a few places where this change could be made even better.
Thus if ``x`` is initially undefined, the ``debug`` task will be skipped. By using ``include_tasks`` instead of ``import_tasks``, | ||
both tasks from ``other_tasks.yml`` will be executed as expected. | ||
|
||
For more information on the differences between ``include`` v ``importing`` see :ref:`playbooks_reuse`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
typo? I'd make this "the differences between include
and import
. . . "
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
The example given here is currently wrong, as the "set_fact" task will be executed when using "import_tasks". Correct and clarify this situation by expanding out what is happening in the easy-to-get-wrong import mode. Add some additional links to "group_by" documentation and the main import/include discussion. Closes: ansible#31596
Thanks @ianw! |
…43856) Correct and clarify "set_fact" example, expanding on what is happening in the easy-to-get-wrong import mode. Add some additional links to "group_by" documentation and the main import/include discussion. Closes: ansible#31596 (cherry picked from commit 6be42a2)
Batch of docs backports: * docs: Clarify include_task v import_tasks with conditionals (#43856) (cherry picked from commit 6be42a2) * Add single quotes around package name (#45152) (cherry picked from commit 0d81386) * prefer ansible_facts namespace and dict notation (#44980) (cherry picked from commit 4451044) * fix cherrypick conflict - scenario_guides * Update implicit_localhost.rst (#45455) (cherry picked from commit f68cd1a) * updated fbsd install instructions (#45309) (cherry picked from commit e9c2695) * Change "Defaulting Undefined Variables" (#41379) (cherry picked from commit e35c4be) * adds license details to dev guide pages (#45574) (cherry picked from commit 6e68d77) * FAQ: fix a typo, add link to 'vars' lookup (#42412) (cherry picked from commit 95649dc) * Fix link and toctree (#45595) (cherry picked from commit 6999bf3) * Improve the local toctree (and title) (#45590) (cherry picked from commit afea00f) * Add undocumented configuration parameter and explain in porting guide (#36059) (cherry picked from commit a892a6e) * Simplify PPA installation for Ubuntu (#45690) (cherry picked from commit 78e9f45) * adding git+ssh uri scheme (#36025) (cherry picked from commit 84a4257) * Add workaround for non-standard kerberos environments (#41465) (cherry picked from commit 4e532e0) * Restore license agreement (#45809) (cherry picked from commit f430f60) * partial cherry-pick - lenovo doc update PR 45483
SUMMARY
The example given here is currently wrong, as the
set_fact
task willbe executed when using
import_tasks
.Correct and clarify this situation by expanding out what is happening
in the easy-to-get-wrong import mode.
Add some additional links to
group_by
documentation and the mainimport/include discussion.
Fixes: #31596
ISSUE TYPE