- name: run a shell command to produce 'a' or 'b' on all boxes and collect the results
run_once: true
shell: return_a_or_b.sh
register: shell_output_collection
with_items: play_hosts
delegate_to: 127.0.0.1- name: count how many are 'a'
set_fact: count_of_a="{{ shell_output_collection.results | map(attribute='stdout') | ???match if value is 'a'??? | list | length }}"