Ansible Module import tasks: Difference between revisions

From NovaOrdis Knowledge Base
Jump to navigation Jump to search
 
Line 11: Line 11:
- import_tasks: some-dir/some-other-file-that-contains-tasks.yaml
- import_tasks: some-dir/some-other-file-that-contains-tasks.yaml
</syntaxhighlight>
</syntaxhighlight>
=<tt>when</tt>=
<code>import_tasks</code> accepts a <code>when</code> clause.
<font color=darkgray>TODO: https://docs.ansible.com/ansible/latest/user_guide/playbooks_conditionals.html#conditionals-with-imports</font>
For more details, see: {{Internal|Ansible_Concepts#when_-_Conditional_Task_Execution|when - Conditional Task Execution}}
=Difference between <tt>include_tasks</tt> and <tt>import_tasks</tt>=
=Difference between <tt>include_tasks</tt> and <tt>import_tasks</tt>=
{{Internal|Ansible Difference between include and import|Difference between include and import}}
{{Internal|Ansible Difference between include and import|Difference between include and import}}

Latest revision as of 05:26, 7 July 2021

External

Internal

Overview

---
- import_tasks: some-file-that-contains-tasks.yaml
- import_tasks: some-dir/some-other-file-that-contains-tasks.yaml

when

import_tasks accepts a when clause.

TODO: https://docs.ansible.com/ansible/latest/user_guide/playbooks_conditionals.html#conditionals-with-imports

For more details, see:

when - Conditional Task Execution

Difference between include_tasks and import_tasks

Difference between include and import