napalm_cli

Executes network device CLI commands and returns response using NAPALM

Parameters

Parameter Required Default Choices Description
args True N/A N/A Keyword arguments to pass to the `cli` method
dev_os False N/A N/A OS of the device
hostname False N/A N/A IP or FQDN of the device you want to connect to
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']
username False N/A N/A Username

Examples

- napalm_cli:

    hostname: "{{ inventory_hostname }}"

    username: "napalm"

    password: "napalm"

    dev_os: "eos"

    args:

        commands:

            - show version

            - show snmp chassis



- napalm_cli:

    provider: "{{ napalm_provider }}"

    args:

        commands:

            - show version

            - show snmp chassis

Return

Name Description Returned Type Sample
changed ALWAYS RETURNS FALSE always bool True
results string of command output always dict { "show snmp chassis": "Chassis: 1234 ", "show version": "Arista vEOS Hardware version: Serial number: System MAC address: 0800.27c3.5f28\nSoftware image version: 4.17.5M Architecture: i386 Internal build version: 4.17.5M-4414219.4175M Internal build ID: d02143c6-e42b-4fc3-99b6-97063bddb6b8\nUptime: 1 hour and 21 minutes Total memory: 1893416 kB Free memory: 956488 kB\n" # noqa }