- hosts: localhost
gather_facts: false
tasks:
- name: Add localhost to all group if no hosts are defined
ansible.builtin.add_host:
name: localhost
ansible_connection: "local"
when: groups['all'] | length == 0
tags:
- always
- hosts: all
tasks:
- ansible.builtin.import_role:
name: "containers"