diff --git a/language_features/register_logic.yml b/language_features/register_logic.yml index 94adce3..083ad84 100644 --- a/language_features/register_logic.yml +++ b/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')