使用debug輸出task執行的register:session
- name: check extract session # script: /app/ansiblecfg/XXX/roles/test/tasks/psgrep.sh > /home/shdxspark/psgrep.log script: /app/ansiblecfg/XXX/roles/test/tasks/psgrep.sh register: psgrep_output #經過debug方式打印psgrep.sh腳本的返回結果psgrep_output - debug: var=psgrep_output.stdout_lines
結果輸出:app