Hi Riku!
Great to hear you've found a solution! In response to the benefits of using the SSH CLI and the REST API versions, with REST API you'll get validation that the upload is complete and successful with the REST API response code you get after executing the code. In addition since this this solution has been posted we've created a AOS-Switch module that should allow you to use the REST API to upload a file without using the URI module, check out arubaoss_file_transfer module:
- name: Upgrade Firmware
arubaoss_file_transfer:
file_url: "http://192.168.1.2/firmware_files/YA_16_10_0001.swi"
file_type: "FTT_FIRMWARE"
action: "FTA_DOWNLOAD"
boot_image: BI_SECONDARY_IMAGE
For SSH CLI, the module just pushes the commands to the switch without validation, so you'll have to ensure the file uploaded successfully yourself using the CLI. It's an alternative option for those who also don't want to enable REST on their switches!