Ansible issues with locate command
What I am trying to accomplish:
Get list of commands that I want to run:
[db2inst1@db2server1 ~]$ locate db2ilist | grep instance
Execute both of the commands above
First issue is that Ansible does not seem to be playing well with the locate command:
- name: Update locate database command: /bin/updatedb - name: Gather DB2 DB2 instances command: /bin/locate 'db2ilist' | /bin/grep 'instance' register: db2ilist_output
I get a rather large list of all files that have ‘instance’ in the name somewhere. I expected to only get the 2 files listed above.
Second issue is… once I have both executables inside the db2ilist_output register, how do I loop through them to execute them?