Hi @jangenent !
I would recommend using our Ansible modules for AOS-Switch! If you're running Ansible version 2.9+ you can use our AOS-Switch collection: https://galaxy.ansible.com/arubanetworks/aos_switch
For transferring images to the switch using REST API, the only server type that's supported is HTTP/HTTPS. The task list you're calling creates a HTTP server on the localhost (Ansible machine) and uses that to transfer the image to the switch. If you're planning on hosting that image on a TFTP server, you may want to use a SSH command to transfer the image.
If you use that collection, and decide to use REST API / a HTTPs server to host the image, you can use the `arubaoss_file_transfer` module with the `arubaoss_reboot`. Your playbook would look like the following:
- hosts: all
collections:
- arubanetworks.aos_switch
tasks:
- name: image upload
arubaoss_file_transfer:
file_url: "http://172.31.254.185/images/WC_16_09_0010.swi"
file_type: "FTT_FIRMWARE"
boot_image: "BI_SECONDARY_IMAGE"
action: "FTA_UPLOAD"
- name: reboot device to new image
arubaoss_reboot:
boot_image: BI_SECONDARY_IMAGE
is_wait: False
If you want to use SSH in conjunction with a TFTP server to host your image, this is what your playbook would look like:
- hosts: all
collections:
- arubanetworks.aos_switch
vars:
ansible_connection: network_cli
tasks:
- name: image upload
arubaoss_command:
commands: ["copy tftp flash 172.31.254.185 WC_16_09_0010.swi secondary"]
- hosts: all
collections:
- arubanetworks.aos_switch
tasks:
- name: reboot device to new image
arubaoss_reboot:
boot_image: BI_SECONDARY_IMAGE
is_wait: False