junos_get_config - Retrieve configuration of device

Author:Rick Sherman, Juniper Networks


New in version 1.2.0.

Retrieve the configuration of a device running Junos and save it to a file. Note unicode chars will be converted to ‘??’ as also done in PyEZ


parameter required default choices comments
dest yes None
    Path to the local server directory where configuration will be saved.
    filter no None
      Defines heircachy of configuration to retrieve. If omitted entire configuration is retrieved. Format is slash notation ex groups/routeinst/routing-instances/ISP-1
      format no text
      • text
      • xml
      text - configuration saved as text (curly-brace) formatxml - configuration saved as XML
      host yes
        Set to {{ inventory_hostname }}
        logfile no None
          Path on the local server where the progress status is logged for debugging purposes
          options no None
            Additional options to pass to get_config. Refer to jnpr.junos.rpcmeta.get_config for details.
            passwd no assumes ssh-key active
              Login password
              port no 830
                TCP port number to use when connecting to the device
                user no $USER
                  Login username


                  Requires junos-eznc >= 1.2.2


                  - junos_get_config:
                     host: "{{ inventory_hostname }}"
                     logfile: get_config.log
                     dest: "{{ inventory_hostname }}.xml"
                     format: xml
                     filter: "interfaces"
                     options: {inherit: inherit, groups: groups}