Ansible Module import tasks: Difference between revisions

From NovaOrdis Knowledge Base
Jump to navigation Jump to search
(Created page with "=External= * https://docs.ansible.com/ansible/latest/collections/ansible/builtin/import_tasks_module.html =Internal= * Ansible Concepts =Over...")
 
 
(3 intermediate revisions by the same user not shown)
Line 2: Line 2:
* https://docs.ansible.com/ansible/latest/collections/ansible/builtin/import_tasks_module.html
* https://docs.ansible.com/ansible/latest/collections/ansible/builtin/import_tasks_module.html
=Internal=
=Internal=
* [[Ansible_Concepts#import_tasks|Ansible Concepts]]
* [[Ansible_Concepts#import_tasks_n723Je|Ansible Concepts | Modules]]
* [[Ansible_Concepts#import_tasks|Ansible Concepts | Importing Tasks]]
 
=Overview=
=Overview=
<syntaxhighlight lang='yaml'>
---
- import_tasks: some-file-that-contains-tasks.yaml
- import_tasks: some-dir/some-other-file-that-contains-tasks.yaml
</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>=
{{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