- name: install sshguard on debian/ubuntu systems gather_facts: yes hosts: servers become: "{{become}}" tasks: - name: install sshguard ansible.builtin.script: cmd: scripts/sshguard-install.bash chdir: /root register: script_output changed_when: >- "changed - all done" in script_output.stdout when: ansible_facts['os_family'] == "Debian" - name: display script stdout debug: var=script_output.stdout_lines when: script_output.stdout is defined - name: display script stderr debug: var=script_output.sterr_lines when: script_output.sterr is defined