junipernetworks.junos.junos_facts (8.0.0) — module

Collect facts from remote devices running Juniper Junos

| "added in version" 1.0.0 of junipernetworks.junos"

Authors: Nathaniel Case (@Qalthos)

Install collection

Install with ansible-galaxy collection install junipernetworks.junos:==8.0.0


Add to requirements.yml

  collections:
    - name: junipernetworks.junos
      version: 8.0.0

Description

Collects fact information from a remote device running the Junos operating system. By default, the module will collect basic fact information from the device to be included with the hostvars. Additional fact information can be collected based on the configured set of arguments.


Requirements

Usage examples

  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: collect default set of facts
  junipernetworks.junos.junos_facts:
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: collect default set of facts and configuration
  junipernetworks.junos.junos_facts:
    gather_subset: config
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Gather legacy and resource facts
  junipernetworks.junos.junos_facts:
    gather_subset: all
    gather_network_resources: all

Inputs

    
config_format:
    choices:
    - xml
    - text
    - set
    - json
    default: text
    description:
    - The I(config_format) argument specifies the format of the configuration when serializing
      output from the device. This argument is applicable only when C(config) value is
      present in I(gather_subset). The I(config_format) should be supported by the junos
      version running on device. This value is not applicable while fetching old style
      facts that is when C(ofacts) value is present in value if I(gather_subset) value.
      This option is valid only for C(gather_subset) values.
    required: false
    type: str

gather_subset:
    default:
    - min
    description:
    - When supplied, this argument will restrict the facts collected to a given subset.  Possible
      values for this argument include C(all), C(hardware), C(config), C(interfaces) and
      C(min). Can specify a list of values to include a larger subset.  Values can also
      be used with an initial C(!) to specify that a specific subset should not be collected.
      To maintain backward compatibility old style facts can be retrieved by explicitly
      adding C(ofacts)  to value, this requires junos-eznc to be installed as a prerequisite.
      Valid value of gather_subset are default, hardware, config, interfaces, ofacts.
      If C(ofacts) is present in the list it fetches the old style facts (fact keys without
      'ansible_' prefix) and it requires junos-eznc library to be installed.
    elements: str
    required: false
    type: list

gather_network_resources:
    description:
    - When supplied, this argument will restrict the facts collected to a given subset.
      Possible values for this argument include all and the resources like interfaces,
      vlans etc. Can specify a list of values to include a larger subset. Values can also
      be used with an initial C(!) to specify that a specific subset should not be collected.
      Valid subsets are 'all', 'interfaces', 'lacp', 'lacp_interfaces', 'lag_interfaces',
      'l2_interfaces', 'l3_interfaces', 'lldp_global', 'lldp_interfaces', 'vlans'.
    elements: str
    required: false
    type: list

available_network_resources:
    default: false
    description: When 'True' a list of network resources for which resource modules are
      available will be provided.
    type: bool

Outputs

ansible_facts:
  description: Returns the facts collect from the device
  returned: always
  type: dict