- name: standard task shell: "some command" register: foo
Instead of having this markup in multiple playbooks, you could create a unique playbook, such as foo.yml, that contains the task. Then, when you need to perform "standard task", you can use the include_tasks statement to include foo.yml, like this.
- include_tasks: foo.yml
include_tasks must be used within tasks, like this.
- hosts: all tasks: - include_tasks: foo.yml
import_playbook cannot be run inside a task meaning that you would use import_playbook to run a play outside of tasks.