- name: fail if role is not defined fail: msg: this_role variable is not defined or is not an object when: this_role is not mapping - name: include role include_role: name: "{{ this_role.role }}" public: "{{ this_role.public | d(false) }}" tasks_from: "{{ this_role.tasks_from | d(omit) }}" vars: function: "{{ this_role.function | d(None) }}"