ansible / ansible.builtin / v2.7.7 / module / ce_file_copy Copy a file to a remote cloudengine device over SCP on HUAWEI CloudEngine switches. | "added in version" 2.4 of ansible.builtin" Authors: Zhou Zhijin (@CloudEngine-Ansible) preview | supported by communityansible.builtin.ce_file_copy (v2.7.7) — module
pip
Install with pip install ansible==2.7.7
Copy a file to a remote cloudengine device over SCP on HUAWEI CloudEngine switches.
- name: File copy test hosts: cloudengine connection: local gather_facts: no vars: cli: host: "{{ inventory_hostname }}" port: "{{ ansible_ssh_port }}" username: "{{ username }}" password: "{{ password }}" transport: cli tasks: - name: "Copy a local file to remote device" ce_file_copy: local_file: /usr/vrpcfg.cfg remote_file: /vrpcfg.cfg file_system: 'flash:' provider: "{{ cli }}"
local_file: description: - Path to local file. Local directory must exist. The maximum length of I(local_file) is C(4096). required: true file_system: default: 'flash:' description: - The remote file system of the device. If omitted, devices that support a I(file_system) parameter will use their default values. File system indicates the storage medium and can be set to as follows, 1) C(flash) is root directory of the flash memory on the master MPU. 2) C(slave#flash) is root directory of the flash memory on the slave MPU. If no slave MPU exists, this drive is unavailable. 3) C(chassis ID/slot number#flash) is root directory of the flash memory on a device in a stack. For example, C(1/5#flash) indicates the flash memory whose chassis ID is 1 and slot number is 5. remote_file: description: - Remote file path of the copy. Remote directories must exist. If omitted, the name of the local file will be used. The maximum length of I(remote_file) is C(4096).
changed: description: check to see if a change was made on the device returned: always sample: true type: boolean local_file: description: The path of the local file. returned: always sample: /usr/work/vrpcfg.zip type: string remote_file: description: The path of the remote file. returned: always sample: /vrpcfg.zip type: string transfer_result: description: information about transfer result. returned: always sample: The local file has been successfully transferred to the device. type: string