Gathers facts from a network device via the Python module napalm


Parameter Required Default Choices Description
args False N/A N/A dictionary of kwargs arguments to pass to the filter. The outer key is the name of the getter (same as the filter)
dev_os False N/A N/A OS of the device
filter False N/A N/A A list of facts to retreive from a device and provided though C(ansible_facts) The list of facts available are maintained at: Note- not all getters are implemented on all supported device types
hostname False N/A N/A IP or FQDN of the device you want to connect to
ignore_notimplemented False N/A N/A Ignores NotImplementedError for filters which aren't supported by the driver. Returns invalid filters in a list called: not_implemented
optional_args False N/A N/A Dictionary of additional arguments passed to underlying driver
password False N/A N/A Password
provider False N/A N/A Dictionary which acts as a collection of arguments used to define the characteristics of how to connect to the device. Note - hostname, username, password and dev_os must be defined in either provider or local param Note - local param takes precedence, e.g. hostname is preferred to provider['hostname']
timeout False N/A N/A Time in seconds to wait for the device to respond
username False N/A N/A Username


- name: get facts from device


    hostname: '{{ inventory_hostname }}'

    username: '{{ user }}'

    dev_os: '{{ os }}'

    password: '{{ passwd }}'

    filter: ['facts']

  register: result

- name: print data


    var: result

- name: Getters


    provider: "{{ ios_provider }}"


      - "lldp_neighbors_detail"

      - "interfaces"

- name: get facts from device


    hostname: "{{ host }}"

    username: "{{ user }}"

    dev_os: "{{ os }}"

    password: "{{ password }}"


      port: "{{ port }}"

    filter: ['facts', 'route_to', 'interfaces']



            protocol: static



Name Description Returned Type Sample
changed whether the command has been executed on the device always bool True
ansible_facts Facts gathered on the device provided via C(ansible_facts) certain keys are returned depending on filter dict