napalm_configure
This task plugin uses nornir-napalm
napalm_configure
task
to configuration commands to devices over SSH or Telnet.
napalm_configure
exists as part of nornir_salt
repository to facilitate
per-host configuration rendering performed by SALT prior to running the task.
Dependencies:
nornir-napalm module required
napalm_configure sample usage
Code to invoke napalm_configure
task:
from nornir import InitNornir
from nornir_salt.plugins.tasks import napalm_configure
nr = InitNornir(config_file="config.yaml")
output = nr.run(
task=napalm_configure,
commands=["interface loopback 0", "description 'configured by script'"]
)
napalm_configure returns
Returns Nornir results object with individual tasks names set equal to commands sent to device.
napalm_configure reference
- nornir_salt.plugins.tasks.napalm_configure.napalm_configure(task: nornir.core.task.Task, config=None, **kwargs)
Nornir Task function to send configuration to devices using
nornir_napalm.plugins.tasks.napalm_configure
plugin.- Parameters
kwargs – any additional arguments to use with
nornir_napalm.plugins.tasks.napalm_configure
pluginconfig – (str or list) configuration string or list of commands to send to device
- Return result
Nornir result object with task execution results