Skip to main content
1 of 2
Vladimir Botka
  • 2.4k
  • 12
  • 14

It's not possible. Quoting from ansible.builtin.import_playbook

Files with a list of plays can only be included at the top level.

The example explicitly shows this

- name: This DOES NOT WORK hosts: all tasks: - debug: msg: task1 - name: This fails because I'm inside a play already import_playbook: stuff.yaml 
Vladimir Botka
  • 2.4k
  • 12
  • 14