いちどシェルの実行結果をいちどansibleの変数 ( return_from_shell ) に入れてから、 デバッグモジュールで表示させる例。 playbook の例 --- - hosts: example tasks: - name: execute shell shell: echo some message register: return_from_shell # 実行結果をansible変数に入れる changed_when: no - name: show previous shell stdout debug: msg: "{{ return_from_shell.stdout }}" # .stdout に標準出力の結果が入っている