--- - name: Run command on servers with sudo hosts: all gather_facts: false become: true vars_prompt: - name: command prompt: Enter a command to run with sudo private: false tasks: - name: Run command shell: "{{ command }}" ignore_errors: true register: results - name: Print results debug: msg: "{{ results.stdout_lines }}"