scrapli_send_config

This task plugin uses nornir-scrapli scrapli_send_config task to send configuration commands to devices over SSH or Telnet.

scrapli_send_config exists as part of nornir_salt repository to facilitate per-host configuration rendering performed by SALT prior to running the task.

Dependencies:

scrapli_send_config sample usage

Code to invoke scrapli_send_config task:

from nornir import InitNornir
from nornir_salt import scrapli_send_config

nr = InitNornir(config_file="config.yaml")

output = nr.run(
    task=scrapli_send_config,
    commands=["sinterface loopback 0", "description 'configured by script'"]
)

scrapli_send_config returns

Returns Nornir results object with individual tasks names set equal to commands sent to device.

scrapli_send_config reference

nornir_salt.plugins.tasks.scrapli_send_config.scrapli_send_config(task: nornir.core.task.Task, config=None, **kwargs)

Nornir Task function to send confgiuration to devices using nornir_scrapli.tasks.send_config plugin

Parameters
  • kwargs – arguments for file.apply_template_on_contents salt function for configuration rendering as well as for task.run method

  • config – (str or list) configuration string or list of commands to send to device

  • commit – not implemented yet

Return result

Nornir result object with task execution results