F5Networks / f5-ansible-bigip

Declarative Ansible collection for managing F5 BIG-IP/BIG-IQ.
37 stars 17 forks source link

Unable to import file using velos_partition_image module #36

Closed crosbygw closed 2 years ago

crosbygw commented 2 years ago
COMPONENT NAME

velos_partition_image

Environment

ANSIBLE VERSION
ansible [core 2.13.3]
  config file = None
  configured module search path = ['/root/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /usr/lib/python3.10/site-packages/ansible
  ansible collection location = /root/.ansible/collections:/usr/share/ansible/collections
  executable location = /usr/bin/ansible
  python version = 3.10.5 (main, Jul 25 2022, 15:52:08) [GCC 11.2.1 20220219]
  jinja version = 3.1.2
  libyaml = False
BIGIP VERSION
velos: 1.4.0-4112
CONFIGURATION
OS / ENVIRONMENT

N/A

SUMMARY

Unable to initiate file transfer. Receive the following error: fatal: [controller4]: FAILED! => {"changed": false, "msg": "{'ietf-restconf:errors': {'error': [{'error-type': 'application', 'error-tag': 'malformed-message', 'error-path': '/f5-utils-file-transfer:file/transfer-status', 'error-message': ' Only configs/ diags/ diags/core/ diags/crash/ diags/shared/ images/ images/import/ images/staging/ log/ log/confd/ log/controller/ log/host/ mibs/ configs/ diags/shared/ configs/ diags/shared/ images/import/iso/ images/import/os/ images/import/services/ images/staging/ paths are allowed for File transfer status operation.'}]}}"}

STEPS TO REPRODUCE
- name: Create Partition
  connection: httpapi
  hosts: "{{lookup('env','controller_inventory_group') or 'controllers_test'}}"
  collections:
    - f5networks.f5_bigip
  any_errors_fatal: true
  tasks:
    - name: Verify partition image is on Velos controller
      velos_partition_image:
        image_name: "{{ image_name }}"
        protocol: https
        remote_host: "{{ server_name }}
        remote_path: "{{ uri_to_file }}"
        state: present
EXPECTED RESULTS
{
    "f5-utils-file-transfer:output": {
        "result": "File transfer is initiated.(images/import/iso/F5OS-C-1.4.0-4112.PARTITION.CANDIDATE.iso)"
    }
}
ACTUAL RESULTS
fatal: [controller4]: FAILED! => {"changed": false, "msg": "{'ietf-restconf:errors': {'error': [{'error-type': 'application', 'error-tag': 'malformed-message', 'error-path': '/f5-utils-file-transfer:file/transfer-status', 'error-message': ' Only configs/ diags/ diags/core/ diags/crash/ diags/shared/ images/ images/import/ images/staging/ log/ log/confd/ log/controller/ log/host/ mibs/ configs/ diags/shared/ configs/ diags/shared/ images/import/iso/ images/import/os/ images/import/services/ images/staging/ paths are allowed for File transfer status operation.'}]}}"}

SUGGESTION

Looks like there is a missing field 'local-file' that is required: https://clouddocs.f5.com/api/velos-api/F5OS-C-1.1.0-api.html#operation/data_f5_utils_file_transfer_file_import_post

While the accepted list for this field is noted in error, the correct input for iso file imports is : images/import/iso/

crosbygw commented 2 years ago

moving request to appropriate project.