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
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
-
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
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
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*: