file_copy¶
File put and get module
Synopsis¶
Copy file over SCP to and from a Juniper device
Module-specific Options¶
The following options may be specified for this module:
parameter | type | required | default | choices | comments |
---|---|---|---|---|---|
action |
str | yes |
Type of operation to execute, currently only support get and put
|
||
file |
str | yes |
Name of the file to copy to/from the remote device
|
||
local_dir |
str | yes |
path of the local directory where the file is located or needs to be copied to
|
||
remote_dir |
str | yes |
path of the directory on the remote device where the file is located or needs to be copied to
|
Examples¶
---
- name: Examples of juniper_device_file_copy
hosts: all
connection: local
gather_facts: false
tasks:
- name: Copy a log file on a remote device locally
juniper.device.file_copy:
remote_dir: /var/log
local_dir: /tmp
action: get
file: log.txt
- name: Copy a local file into /var/tmp on the remote device
juniper.device.file_copy:
remote_dir: /var/tmp
local_dir: /tmp
action: put
file: license.txt
Status¶
This module is flagged as stableinterface which means that the maintainers for this module guarantee that no backward incompatible interface changes will be made.