Faced with a similar issue, I initially wrote a script to which I could
pass all my parameters to be operated on, and then a custom module :-)
On Thursday, 17 March 2016 23:49:50 UTC, Arthur Reyes wrote:
>
> I have a series of commands registered to the same var
>
> - shell: ls -alh'{{ item }}'
> register:cmd_output
> with_items:
> - '/home/1'
> - '/home/2'
>
> For some plays, I only need to evaluate a specific stdout. Assuming I want
> to the results of 'ls -alh /home/2', my current method is to loop through
> cmd_output and return stdout when the cmd matches my criteria:
>
> - debug:
> msg: '{{ item.stdout }}'
> when: ( '{{ item.cmd }}' == 'ls -alh /home/1' )
> with_items: '{{ cmd_output.results }}'
>
> Is there a way to do this instead of looping through cmd_output.results?
>
>
--
You received this message because you are subscribed to the Google Groups
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/ansible-project/0b4516f9-6b50-4ed3-97c7-2339af1da16d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.