[ansible-project] ansible-galaxy newb error

2022-09-10 Thread Andy Bach
Hi, I am pretty new to Ansible, and followed Learn Linux TV's excellent tutorial series. In which, one of the last things we do is refactor things into different roles/tasks. I am trying to follow the rvm1-ansible "role" I downloaded using: ansible-galaxy install rvm.ruby however, I can

Re: [ansible-project] Ansible dict date to csv file

2022-09-10 Thread Vladimir Botka
Create the list. Put the below declarations into *vars* csv_query: '[].[`Clusters`, key, value[].node, value[].state]' csv: "{{ Clusters|dict2items|json_query(csv_query)| map('flatten')|map('join', ',')|list }}" gives csv: - Clusters,192.168.1.1,node1,up -

Re: [ansible-project] Re: Ansible dict date to csv file

2022-09-10 Thread Stefan Hornburg (Racke)
On 10/09/2022 18:44, Sagan wrote: IF you have your closters has dicts in your variable you can use a loop with dict2items and loop around it, as to writing it in your file you can use this module https://docs.ansible.com/ansible/latest/collections/ansible/builtin/lineinfile_module.html Using

[ansible-project] Re: Ansible dict date to csv file

2022-09-10 Thread Sagan
IF you have your closters has dicts in your variable you can use a loop with dict2items and loop around it, as to writing it in your file you can use this module https://docs.ansible.com/ansible/latest/collections/ansible/builtin/lineinfile_module.html On Saturday, September 10, 2022 at 5:47:07

[ansible-project] Ansible dict date to csv file

2022-09-10 Thread Aharonu
Hello All, I'm looking for help on below guery. As bit new to Anisble I could not find solution thought I sent lot of time.. Thank you in advance. I have data getting through set_fact/ *json_query* using *loop* for multiple clusters as below example. I have saved date to *variable*: