salt.modules.napalm module

NAPALM helpers

Helpers for the NAPALM modules.

New in version 2017.7.0.

salt.modules.napalm.alive(*args, **kwargs)

Returns the alive status of the connection layer. The output is a dictionary under the usual dictionary output of the NAPALM modules.

CLI Example:

salt '*' napalm.alive

Output Example:

result: True
out:
    is_alive: False
comment: ''
salt.modules.napalm.call(*args, **kwargs)

Execute arbitrary methods from the NAPALM library. To see the expected output, please consult the NAPALM documentation.

Note

This feature is not recommended to be used in production. It should be used for testing only!

CLI Example:

salt '*' napalm.call get_lldp_neighbors
salt '*' napalm.call get_firewall_policies
salt '*' napalm.call get_bgp_config group='my-group'
salt.modules.napalm.compliance_report(*args, **kwargs)

Return the compliance report.

filepath
The absolute path to the validation file.

CLI Example:

salt '*' napalm.compliance_report ~/validate.yml

Validation File Example:

- get_facts:
    os_version: 4.17

- get_interfaces_ip:
    Management1:
        ipv4:
            10.0.2.14:
                prefix_length: 24
            _mode: strict

Output Example:

device1:
    ----------
    comment:
    out:
        ----------
        complies:
            False
        get_facts:
            ----------
            complies:
                False
            extra:
            missing:
            present:
                ----------
                os_version:
                    ----------
                    actual_value:
                        15.1F6-S1.4
                    complies:
                        False
                    nested:
                        False
        get_interfaces_ip:
            ----------
            complies:
                False
            extra:
            missing:
                - Management1
            present:
                ----------
        skipped:
    result:
        True
salt.modules.napalm.reconnect(*args, **kwargs)

Reconnect the NAPALM proxy when the connection is dropped by the network device. The connection can be forced to be restarted using the force argument.

Note

This function can be used only when running proxy minions.

CLI Example:

salt '*' napalm.reconnect
salt '*' napalm.reconnect force=True