Processing data from Node

What is the best approach using ansible to

  1. Query data from a VM
  2. Operate on the results
    I need to look up the sd device serial numbers on the VM then process that locally (on node running ansible) then run another playbook using the results to create LVM entities, file systems etc.I can find way to query the data I need, I can write python/shell to process the returned results but I was looking to do more within ansible. Any direction would be appreciated

Do you have any specific questions?
Otherwise the best way forward is to just start here:
https://docs.ansible.com/ansible/latest/user_guide/intro_getting_started.html
Start simple then gradually work your way to more complex playbooks.