Merge pull request #105 from asymmetric/patch-1

Add examples for `stdout` loops
pull/63/head
Brian Coca 9 years ago
commit 72cca7331f
  1. 10
      language_features/register_logic.yml

@ -29,5 +29,15 @@
- shell: echo "motd contains the word hi"
when: motd_result.stdout.find('hi') != -1
# you can use 'stdout_lines' to loop over the registered output lines
- name: motd lines matching 'hi'
shell: echo "{{ item }}"
with_items: motd_result.stdout_lines
# you can also split 'stdout' yourself
- name: motd lines matching 'hi'
shell: echo "{{ item }}"
with_items: motd_result.stdout.split('\n')