junos_get_table - Retrieve data from a Junos device using Tables/Views

Author:Jason Edelman (@jedelman8)

Synopsis

New in version 1.9.0.

Retrieve data from a Junos device using Tables/Views

Options

parameter required default choices comments
file no None
    YAML file that has the table specified in table parameter
    host yes
      Set to {{ inventory_hostname }}
      logfile no None
        Path on the local server where the progress status is logged for debugging purposes
        mode no None
          mode of console connection (telnet/serial). If mode is not provided SSH connection is used.
          passwd no assumes ssh-key active
            Login password
            path no op directory in jnpr.junos.op
              Path of location of the YAML file
              port no 830
                port number to use when connecting to the device
                response_type no list_of_dicts
                  Option to change how data is returned from the module. Either list of dictionaries or the Juniper PyEZ default (list of tuples, which becomes lists by the time it gets to Ansible)
                  table no None
                    Name of PyEZ Table
                    user no $USER
                      Login username

                      Note

                      Requires junos-eznc >= 1.2.2

                      Examples


                      # GET NEIGHBOR INFO USING STD LLDP TABLE
                      - junos_get_table: table=LLDPNeighborTable file=lldp.yml host={{ inventory_hostname }} user={{ un }} passwd={{ pwd }}
                      
                      # GET NEIGHBOR INFO USING CUSTOM LLDP TABLE IN CUSTOM PATH
                      - junos_get_table: table=NTCNeighborTable path=tables/ file=ntclldp.yaml host={{ inventory_hostname }} user={{ un }} passwd={{ pwd }}
                      
                      #
                      - name: Table/View example via console server connection using PyEZ >= 2.0
                        junos_get_table:
                          table=RouteTable
                          file=routes.yml
                          host={{ inventory_hostname }}
                          port=7016
                          mode='telnet'