--- - name: "Apply role {{ myrole }} to hosts: {{ myhosts }}" hosts: "{{ myhosts }}" pre_tasks: - name: cook some variables for roles that expect them to be cooked set_fact: install_cooked: "{{ install | default({}) }}" network_cooked: "{{ network | default({}) }}" vm_host_cooked: "{{ vm_host | default({}) }}" roles: - role: "{{ myrole }}"