--- - hosts: all gather_facts: no tasks: - command: cat /etc/hosts register: output changed_when: '"tn00-cento" in output.stdout'