--- - hosts: '{{ ip_addr }}' become: yes become_method: sudo gather_facts: yes tasks: - name: "[CONFIG RELAYHOST SMTP] Comprobando si es necesario configurar relayhost smtp" debug: msg: "No es necesario configurar relayhost smtp en la máquina" when: relay_host_enabled is not defined or not relay_host_enabled - name: "[CONFIG RELAYHOST SMTP] Config relayhost smtp" import_role: name: config-relayhost-smtp when: relay_host_enabled is defined and relay_host_enabled