I have written an Ansible playbook that returns some information from various sources. One of the variables I am saving during a task is the number of records in a certain MySQL database table.
I can print out results in the playbook quite well. What I want to do however is write the results from all hosts in a single (csv) file on the master/control server or computer running the playbook
- name: Show resultsdebug:msg: "URL: {{hostvars[inventory_hostname]['ansible_nodename']}} RECORDCOUNT: {{results.stdout}} BASE VERSION: {{baseversion.stdout}}"
This task prints the info I want for twenty nodes.
I now want to write this line in a single CSV file on the master server.
I've tried various things with local copy but until now to no avail.