Hi All,
I want to implement a logic for below requirement
block:
- name: A task
shell: grep '{{ item }} is present ' /in/a/file
register: output
with_items: "{{ host_group }}"
always:
- set_fact:
failed_items: <All the items for which the result is failed>
However, the output is a list. And each item in the list would contain rc, whose value could be true or false based on the item in the group.
Is there a way to find the items for which the task is failed and construct a final result string.
Thanks in advance,
Ramu