Task in some play imports or includes role (for the project here roles used in playbook are grabbed from external repositories, not in one repo along with playbook).
Within role each item starting with “-name:” line is also called “a task” - as I guess.
Please compare with https://docs.ansible.com/ansible/latest/user_guide/playbooks_reuse_roles.html section “Using Roles” and roles/example/tasks/main.yml in section “Role Directory Structure”.
So the structure looks like task (play-level) > sub-task (each entry starting with "name: "-line in role). Is this the proper understanding?
Does it eventually work in other way: if task was open at play level one does not must open a task in role imported/included from that play, and vice-versa?
`name` is an optional keyword in a task the `-` and the actual action
are the 'important parts', be it in a role or directly in a play does
not change the nature of a task.
By which term can one refer to every item in role file starting with “- name: ” or with “<module_name>:” ?
By which term can one refer to every item in playbook file starting with “- name: ” or with “import_role:”?
By which term can one refer to every item in role file starting with "- name: <task name>" or with "<module_name>:" ?
depends on teh file, but it looks like you mean tasks/main.yml, those
are 'tasks'
By which term can one refer to every item in playbook file starting with "- name: <task name>" or with "import_role:"?
import_role is an action of a task, not everything in a playbook that
starts with "-" is a task, tasks must be inside plays, anything 'top
level' of a playbook is a play
Yes, I missed to make update of my question precising these points. Sorry for that.
Yes, if it concerns role files I mean “- name: ” or with “<module_name>:” -lines in tasks/main.yml
If it concerns playbook files I mean “- name: ” or with “import_role:” items conducting the import of a role, latter one addressed in the point above.
You claim import_role is an action of a task. So in end-effect task at playbook-level is including another tasks provided by role. How to differentiate in discussions between these two tasks? parent and child tasks? In any other way?
include_tasks/import_tasks/include_role/import_role all capable of
expanding the task list via other files, not sure what you mean by
parent/child .. there is really not that concept at task level.
Role defines a tasks. It does it at the point where in play an entry (which appears to be a task) imports that role > in end-effect a task within another task,
or how to understand this