Used to copy local files to remote host.
docs used to help create this page.
def test_fun(duthosts, rand_one_dut_hostname):
duthost = duthosts[rand_one_dut_hostname]
duthost.copy(src="/local/file/path.txt/", dest="/remote/file/path.txt")
src- desired path for file to be copied- Required:
True - Type:
String
- Required:
dest- desired destination on the remote host- Required:
True - Type:
String
- Required:
attributes- Attributes the resulting file should have- Required:
False - Type:
String
- Required:
backup- Create backup file with timestamp- Required:
False - Type:
Boolean - Default:
False
- Required:
checksum- SHA1 checksum of the file being transferred. Used to validate final file. If not provided, ansible will generate it.- Required:
False - Type:
String
- Required:
decrypt- Controls autodecryption of source files using vault.- Required:
False - Type:
Boolean - Default:
True
- Required:
directory_mode- For defining permissions of copied directories. Uses system defaults if not defined. Can use symbolic "u=rw,g=r,o=rx"- Required:
False - Type:
String
- Required:
owner- Name of use that should own file/directory- Required:
False - Type:
String
- Required:
remote_src- Whethersrcis on the remote host or on the calling device.- Required:
False - Type:
Boolean - Default:
False
- Required:
selevel- the level part of the Security Enchanced Linux file context- Required:
False - Type:
String
- Required:
serole- The role part of the Security Enchanced Linux file context- Required:
False - Type:
String
- Required:
setype- the type part of the Security Enchanced Linux file context- Required:
False - Type:
String
- Required:
seuser- the user part of the Security Enchanced Linux file context- Required:
False - Type:
String
- Required:
unsafe_writes- Allows Ansible to do unsafe_writes in the case that atomic operations are failing.- Required:
False - Type:
Boolean - Default:
False
- Required:
validate- Path to validation function used to very file integrity- Required:
False - Type:
String
- Required:
Returns dictionary that provides info on the copied file.
backup_file- path and name for backup file createdchecksum- SHA1 checksum for copied filedest- Destination path for filegid- Group id of the filegroup- group name of the filemd5sum- MD5 checksum of the copied filemode- permissions of the copied fileowner- name of ownersize- size of copied filesrc- source file was copied fromstate- staet of the copied file (file,directory)uid- Owner id for the file