Hi Dick, it's the content of the result.json

I do have a task that connects to the server and dumps the results.json.
For ease of troubleshooting it's quicker to run it from a file but the end
result is to get it directly from the mentioned task.


On Thu 20 May 2021, 05:11 Dick Visser, <dick.vis...@geant.org> wrote:

>
>
> On Thu, 20 May 2021 at 01:17, Rodrigues - <bugpr...@gmail.com> wrote:
>
>> I'm trying to parse the json output of a VMware DVSwitch which i've
>> extracted using Ansible module community.vmware.vmware_dvs_portgroup_info
>>
>> using this role, however i can't seem to get to the portgroups, can only
>> display the full json. What i'm i missing?
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>> *- hosts: 127.0.0.1 connection: local become: yes vars_files: -
>> answerfile_test.yml - ../cred.yaml vars: dvs: "{{ lookup('file',
>> 'result.json') }}" tasks: - name: Simple debug. debug: msg: "{{
>> dvs.dvs_portgroup_info[\"DVS-Dev-Ork2\"] }}" tags: - G2*
>>
>>
>> Json output here:
>>
>
> Is this the json output of the debug task or the content of the
> result.json file?
>
> Also, why are you using an intermediate file?
> Why not have that vmware_dvs_portgroup_info task be prior to the ones in
> the playbook you posted?
>
>
>> {"changed": false, "dvs_portgroup_info": {"DVS-Dev-Ork2":
>> [{"portgroup_name": "Test - 192.168.20.0_24 - VMotion - 1", "num_ports": 8,
>> "dvswitch_name": "DVS-Dev-Ork2", "description": null, "type":
>> "earlyBinding", "teaming_policy": {"policy": "loadbalance_ip",
>> "inbound_policy": true, "notify_switches": true, "rolling_order": false},
>> "port_policy": {"block_override": true, "ipfix_override": false,
>> "live_port_move": false, "network_rp_override": false,
>> "port_config_reset_at_disconnect": true, "security_override": false,
>> "shaping_override": false, "traffic_filter_override": false,
>> "uplink_teaming_override": false, "vendor_config_override": false,
>> "vlan_override": false}, "network_policy": {"forged_transmits": false,
>> "promiscuous": false, "mac_changes": false}, "vlan_info": {"trunk": false,
>> "pvlan": false, "vlan_id": "20"}, "key": "dvportgroup-14"},
>> {"portgroup_name": "Test - 192.168.60.0_24 - Management", "num_ports": 15,
>> "dvswitch_name": "DVS-Dev-Ork2", "description": null, "type":
>> "earlyBinding", "teaming_policy": {"policy": "loadbalance_ip",
>> "inbound_policy": true, "notify_switches": true, "rolling_order": false},
>> "port_policy": {"block_override": true, "ipfix_override": false,
>> "live_port_move": false, "network_rp_override": false,
>> "port_config_reset_at_disconnect": true, "security_override": false,
>> "shaping_override": false, "traffic_filter_override": false,
>> "uplink_teaming_override": false, "vendor_config_override": false,
>> "vlan_override": false}, "network_policy": {"forged_transmits": false,
>> "promiscuous": false, "mac_changes": false}, "vlan_info": {"trunk": false,
>> "pvlan": false, "vlan_id": "0"}, "key": "dvportgroup-13"},
>> {"portgroup_name": "Test - 192.168.30.0_24 - VSAN", "num_ports": 8,
>> "dvswitch_name": "DVS-Dev-Ork2", "description": null, "type":
>> "earlyBinding", "teaming_policy": {"policy": "loadbalance_ip",
>> "inbound_policy": true, "notify_switches": true, "rolling_order": false},
>> "port_policy": {"block_override": true, "ipfix_override": false,
>> "live_port_move": false, "network_rp_override": false,
>> "port_config_reset_at_disconnect": true, "security_override": false,
>> "shaping_override": false, "traffic_filter_override": false,
>> "uplink_teaming_override": false, "vendor_config_override": false,
>> "vlan_override": false}, "network_policy": {"forged_transmits": false,
>> "promiscuous": false, "mac_changes": false}, "vlan_info": {"trunk": false,
>> "pvlan": false, "vlan_id": "25"}, "key": "dvportgroup-15"},
>> {"portgroup_name": "DVS-Dev-Ork2-DVUplinks-11", "num_ports": 18,
>> "dvswitch_name": "DVS-Dev-Ork2", "description": null, "type":
>> "earlyBinding", "teaming_policy": {"policy": "loadbalance_srcid",
>> "inbound_policy": true, "notify_switches": true, "rolling_order": false},
>> "port_policy": {"block_override": true, "ipfix_override": false,
>> "live_port_move": false, "network_rp_override": false,
>> "port_config_reset_at_disconnect": true, "security_override": false,
>> "shaping_override": false, "traffic_filter_override": false,
>> "uplink_teaming_override": false, "vendor_config_override": false,
>> "vlan_override": false}, "network_policy": {"forged_transmits": true,
>> "promiscuous": false, "mac_changes": false}, "vlan_info": {"trunk": true,
>> "pvlan": false, "vlan_id": ["0-4094"]}, "key": "dvportgroup-12"}]},
>> "failed": false}
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Ansible Project" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to ansible-project+unsubscr...@googlegroups.com.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/ansible-project/2e0721b8-2622-4366-a619-dfc4ffd5d007n%40googlegroups.com
>> <https://groups.google.com/d/msgid/ansible-project/2e0721b8-2622-4366-a619-dfc4ffd5d007n%40googlegroups.com?utm_medium=email&utm_source=footer>
>> .
>>
> --
> Sent from a mobile device - please excuse the brevity, spelling and
> punctuation.
>
> --
> You received this message because you are subscribed to a topic in the
> Google Groups "Ansible Project" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/ansible-project/4UGVr3aRxbQ/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to
> ansible-project+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/ansible-project/CAL8fbwOOyTSvtkdskw8hg2DRFM_0up63r1MVbiAOB%2BXS%2Bj2Yqg%40mail.gmail.com
> <https://groups.google.com/d/msgid/ansible-project/CAL8fbwOOyTSvtkdskw8hg2DRFM_0up63r1MVbiAOB%2BXS%2Bj2Yqg%40mail.gmail.com?utm_medium=email&utm_source=footer>
> .
>

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ansible-project+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/CAHCxOD%2BYsU66uvv1pO4EDTx5y-8b91xj83CAFuDs_jdyXz68DQ%40mail.gmail.com.

Reply via email to