- hosts: containers
  gather_facts: no
  serial: 1
  strategy: linear
  tasks:
    - name: include common container role
      include_role:
        name: container


    - name: check if host role exists
      stat:
        path: "{{ (playbook_dir, 'roles', host_role | d(inventory_hostname), 'tasks/main.yml') | path_join }}"
      register: result
      delegate_to: localhost


    - name: include host role
      include_role:
        name: "{{ host_role | d(inventory_hostname) }}"
      when: result.stat.exists
