Skip to content

Instantly share code, notes, and snippets.

@shirou
Last active August 27, 2015 09:22
Show Gist options
  • Save shirou/6670bca78673d8e150d5 to your computer and use it in GitHub Desktop.
Save shirou/6670bca78673d8e150d5 to your computer and use it in GitHub Desktop.
- name: sh run
raw : "show run"
register: show_run
- name: sh run output
local_action: shell /bin/echo "{{ item }}" >> /tmp/hoge # >> なのに注意。この前に書き出し先ファイルを消しておく必要があるかも
with_items: show_run.stdout_lines
# joinを使う方式では、空白が削られてしまった。
# - name: sh run output
# local_action: shell /bin/echo "{{ show_run.stdout_lines | join('\n')}}" > /tmp/hoge
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment