Hey guys, i need to log into a local file the user’s group of a specific user for all the Virtual Machines my Vcenter hosts. Actually my playbook works, but there’s a issue because the data is overwritten on the destination file, so only the information of the last virtual machine results.
(i’m new to Ansible, can anyone help me?)
That’s the code i worte:
- hosts: all
tasks: - command: groups user
register: store - local_action: “copy content=‘{{inventory_hostname}} {{ store.stdout }}\n’ dest=/etc/ansible/usergroups.txt”
Thank you