Tasks
- nornir_paramiko.plugins.tasks.paramiko_command(task, command)
Executes a command remotely on the host :type command:
str:param command: The command to execute- Returns:
result (
str): stderr or stdoutstdout (
str): stdoutstderr (
str): stderr
- Return type:
Resultobject with the following attributes set- Raises:
nornir_paramiko.exceptions.CommandError – When there is a command error.
- nornir_paramiko.plugins.tasks.paramiko_sftp(task, src, dst, action, dry_run=None, compare=True)
Transfer files from/to the device using sftp protocol
- Parameters:
dry_run (
Optional[bool]) – Whether to apply changes or notsrc (
str) – source filedst (
str) – destinationaction (
Literal['get','put']) –put,get.compare (
bool) – Compare the src and dst file usingsha1sum. This requires the host to support SFTP.
- Returns:
changed (
bool):files_changed (
list): list of files that changed
- Return type:
Resultobject with the following attributes set
Examples
Put README.md to /tmp/README.md:
nornir.run( files.sftp, action="put", src="README.md", dst="/tmp/README.md" )