Skip to content

Instantly share code, notes, and snippets.

@h4ndzdatm0ld
Created September 23, 2020 22:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save h4ndzdatm0ld/759161287434cdb4e464884c41309710 to your computer and use it in GitHub Desktop.
Save h4ndzdatm0ld/759161287434cdb4e464884c41309710 to your computer and use it in GitHub Desktop.
NC Nornir - Example by russo, n
def netconf_edit_config(task, target, config, **kwargs):
"""
Nornir task to issue a NETCONF edit_config RPC with optional keyword
arguments. Both the target and config arguments must be specified.
"""
conn = task.host.get_connection("netconf", task.nornir.config)
result = conn.edit_config(target=target, config=config, **kwargs)
return Result(host=task.host, result=result)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment