mirror of
https://github.com/ansible/ansible.git
synced 2026-08-03 08:03:05 +02:00
Docs: file parameter import_tasks and include_tasks (#79077)
* issue #79022 file parameter import_tasks and include_tasks * adding details back * Update lib/ansible/modules/import_tasks.py Co-authored-by: Felix Fontein <felix@fontein.de> * Update lib/ansible/modules/include_tasks.py Co-authored-by: Felix Fontein <felix@fontein.de> * use pipe as in original version Co-authored-by: Felix Fontein <felix@fontein.de>
This commit is contained in:
co-authored by
Felix Fontein
parent
3a6eca6670
commit
8d94a95ccf
@@ -18,9 +18,15 @@ version_added: "2.4"
|
||||
options:
|
||||
free-form:
|
||||
description:
|
||||
- The name of the imported file is specified directly without any other option.
|
||||
- Most keywords, including loops and conditionals, only applied to the imported tasks, not to this statement itself.
|
||||
- |
|
||||
Specifies the name of the imported file directly without any other option C(- import_tasks: file.yml).
|
||||
- Most keywords, including loops and conditionals, only apply to the imported tasks, not to this statement itself.
|
||||
- If you need any of those to apply, use M(ansible.builtin.include_tasks) instead.
|
||||
file:
|
||||
description:
|
||||
- Specifies the name of the file that lists tasks to add to the current playbook.
|
||||
type: str
|
||||
version_added: '2.7'
|
||||
extends_documentation_fragment:
|
||||
- action_common_attributes
|
||||
- action_common_attributes.conn
|
||||
@@ -50,7 +56,8 @@ EXAMPLES = r'''
|
||||
msg: task1
|
||||
|
||||
- name: Include task list in play
|
||||
ansible.builtin.import_tasks: stuff.yaml
|
||||
ansible.builtin.import_tasks:
|
||||
file: stuff.yaml
|
||||
|
||||
- ansible.builtin.debug:
|
||||
msg: task10
|
||||
|
||||
@@ -18,9 +18,7 @@ version_added: '2.4'
|
||||
options:
|
||||
file:
|
||||
description:
|
||||
- The name of the imported file is specified directly without any other option.
|
||||
- Unlike M(ansible.builtin.import_tasks), most keywords, including loop, with_items, and conditionals, apply to this statement.
|
||||
- The do until loop is not supported on M(ansible.builtin.include_tasks).
|
||||
- Specifies the name of the file that lists tasks to add to the current playbook.
|
||||
type: str
|
||||
version_added: '2.7'
|
||||
apply:
|
||||
@@ -31,8 +29,10 @@ options:
|
||||
free-form:
|
||||
description:
|
||||
- |
|
||||
Supplying a file name via free-form C(- include_tasks: file.yml) of a file to be included is the equivalent
|
||||
of specifying an argument of I(file).
|
||||
Specifies the name of the imported file directly without any other option C(- include_tasks: file.yml).
|
||||
- Is the equivalent of specifying an argument for the I(file) parameter.
|
||||
- Most keywords, including loop, with_items, and conditionals, apply to this statement unlike M(ansible.builtin.import_tasks).
|
||||
- The do-until loop is not supported.
|
||||
extends_documentation_fragment:
|
||||
- action_common_attributes
|
||||
- action_common_attributes.conn
|
||||
@@ -60,7 +60,8 @@ EXAMPLES = r'''
|
||||
msg: task1
|
||||
|
||||
- name: Include task list in play
|
||||
ansible.builtin.include_tasks: stuff.yaml
|
||||
ansible.builtin.include_tasks:
|
||||
file: stuff.yaml
|
||||
|
||||
- ansible.builtin.debug:
|
||||
msg: task10
|
||||
|
||||
Reference in New Issue
Block a user