Forum Discussion

forsan_102218's avatar
forsan_102218
Icon for Nimbostratus rankNimbostratus
Nov 06, 2018
Solved

Ansible bigip_device_facts - Filter Output

Hi, I'm new to ansible and have installed ansible version 2.7 and I'm trying to understand how I can filter the output from the new bigip_device_facts module as bigip_facts are depreciated. I ha...
  • Alex_240062's avatar
    Nov 08, 2018

    The result from bigip_device_facts contains a list of dictionaries. It can be processed in a number of ways depending on the output you want, but here's a simple example how to print the output with debug:

      - bigip_device_facts:
          provider: "{{ provider_vars }}"
          gather_subset:
            - vlans
        register: gathered_facts
    
      - name: "Debug vlans"
        debug:
          msg: "VLAN {{ item.name }} has tag {{ item.tag }}"
        with_items: "{{ gathered_facts.vlans }}"