- name: install yandex-ua on debian/ubuntu systems gather_facts: yes hosts: servers become: "{{become}}" tasks: - name: install yandex-ua ansible.builtin.script: cmd: scripts/yandexua-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