Hi,

I want to know how can I pass a dictionary (ansible fact) as a variable to 
another module.  Following are the details:

I gather my ansible fact using the following code:

 - name: Gather information from lldp
   lldp:
- name: Printing LLDP information gathered
  debug: msg="{{ lldp}}"

The gathered lldp ansible fact looks like this:

TASK [Printing LLDP information gathered] 
**************************************
ok: [10.***.**.***] => {
    "changed": false, 
    "msg": {
            "Ethernet0": {
                "age": "5 days, 08:22:01", 
                "chassis": {
                    "Bridge": {
                        "enabled": "on"
                    }, 
                    "Router": {
                        "enabled": "on"
                    }, 
                    "name": "CVCCCPSCH0103001MS"
                }, 
                "port": {
                    "descr": "CCPSCH01030CCLF:fortyGigE0/0", 
                    "ifname": "Ethernet51/1", 
                    "mfs": "9236"
                }, 
                "rid": "1", 
                "via": "LLDP"
        },
    }

I want to pass the gathered lldp fact as a parameter to another module as 
follows:
- name: Gathering basic lldp facts about the device
  my_facts_module: lldpdata={{lldp}} version=v2c community={{ 
snmp_rocommunity }}
  connection: local

But this does not work.  Any suggestions how can I resolve this?

Thanks,
Samir

-- 
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 post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/9eb445c3-7ccc-4706-98d5-1ea7dd016a02%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to