HuaweiSwitch / CloudEngine-Ansible

Ansible modules to automate HUAWEI CloudEngine switches
GNU General Public License v3.0
144 stars 51 forks source link

ce_file_copy is failing with deafult value for file_system #37

Open rikard0 opened 6 years ago

rikard0 commented 6 years ago
fatal: [swt1-rlab.mgm.lsoffice.cz]: FAILED! => {
    "changed": false,
    "invocation": {
        "module_args": {
            "file_system": "flash:",
            "host": "swt1-rlab.mgm.lsoffice.cz",
            "local_file": "/data/ansible/storage//CE5855EI-V200R003C00SPC810.cc",
            "password": null,
            "port": 22,
            "provider": {
                "host": "swt1-rlab.mgm.lsoffice.cz",
                "password": null,
                "port": 22,
                "timeout": null,
                "transport": "cli",
                "use_ssl": null,
                "username": "netoor",
                "validate_certs": null
            },
            "remote_file": "CE5855EI-V200R003C00SPC810.cc",
            "timeout": null,
            "transport": "cli",
            "use_ssl": null,
            "username": "netoor",
            "validate_certs": null
        }
    },
    "msg": "Could not transfer file. There was an error during transfer. Please make sure the format of input parameters is right."
}

playbook task:

  - name: COPYING IMAGE TO DEVICE FLASH
    ce_file_copy:
      provider: "{{ cli }}"
      local_file: "{{ file_storage }}/{{ local_image }}"
      remote_file: "{{ remote_image }}"

It works fine when I use this config for task in playbook:

  - name: COPYING IMAGE TO DEVICE FLASH
    ce_file_copy:
      provider: "{{ cli }}"
      local_file: "{{ file_storage }}/{{ local_image }}"
      file_system: "flash:/"
      remote_file: "{{ remote_image }}"

The file_system or remote_file should be checked in ce_file_copy.py value and if ther is '/' missing, than added it automaticaly.