--- - name: Risotto hosts: all tasks: - name: "Build host files" rougail: hostname: "{{ vars['inventory_hostname'] }}" only_machine: "{{ only_machine }}" configure_host: "{{ configure_host }}" copy_tests: "{{ copy_tests }}" copy_templates: "{{ copy_templates }}" register: build_host - name: Print return information from the previous task ansible.builtin.debug: var: build_host - name: "Configure the host" include_tasks: host.yml when: configure_host == true - name: "Prepare machine configuration" include_tasks: machine.yml when: item.name in build_host.machines_changed loop: "{{ vars | machineslist(only=only_machine) }}" # - name: "Remove images" # include_tasks: remove_image.yml # loop: "{{ vars | machineslist(only=only_machine) }}" # when: delete_old_image == true # - name: "Install and apply configurations" include_tasks: machines.yml