Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

arubaoss_file_transfer - SSH command execution is not supported #78

Open
bsiefers opened this issue Jul 12, 2023 · 3 comments
Open

arubaoss_file_transfer - SSH command execution is not supported #78

bsiefers opened this issue Jul 12, 2023 · 3 comments

Comments

@bsiefers
Copy link

Hi,
I am trying to run a firmware update for a hp Aruba server. I am running into a issue where non-interactive ssh commands are not supported. I receive the message "SSH command execution is not supported" as a result.

This is what my play looks like.

---
- hosts: "{{ hosts }}"
  name: Download Firmware Image To Hosts And Reboot
  collections:
    - arubanetworks.aos_switch
  tasks:
    - name: Upgrade Firmware via SSH CLI
      arubaoss_file_transfer:
          file_url: "https://{{http_server}}/firmware/KB_16_11_0004.swi"
          file_type: "FTT_FIRMWARE"
          boot_image: "BI_SECONDARY_IMAGE"
          action: "FTA_DOWNLOAD"

Is there any support for non-ssh usage, or using the interactive shell? Let me know if you know of any ways to get around this issue. Thanks!

@alagoutte
Copy link
Contributor

Hi,

What the actual firmware on switch ?

Do you have try with HTTP for download ?

@bsiefers
Copy link
Author

bsiefers commented Jul 13, 2023

The switch is:
HP J9850A Switch 5406Rzl2
Software revision KB.16.11.0012

We are open to any alternatives that would work within ansible.

@tchiapuziowong
Copy link
Member

Hi @bsiefers what you're trying to use is a REST API module - is your ansible_connection: local?

To use SSH to execute CLI commands you'll want to use the arubaoss_command module and set the ansible_connection: network_cli

Here's an example playbook:

- hosts: all
  collections:
    - arubanetworks.aos_switch
  gather_facts: False
  vars:
    ansible_connection: network_cli        
  tasks:
    - name: Copy Image to Switch via TFTP
      arubaoss_command:
        commands:
          - command: "copy tftp flash 10.80.2.153 WC_16_11_0013.swi secondary oobm"
            check_all: true
            prompt:
              - '.*\(y\/n\)\?.*'
            answer:
              - 'y'

    - name: Copy Image to Switch via SFTP
      arubaoss_command:
        commands:
          - command: "copy sftp flash [email protected] WC_16_11_0013.swi secondary oobm"
            check_all: true
            prompt:
              - '.*\(y\/n\)\?.*'
              - '.*password\?.*'
            answer:
              - 'y'
              - 'password'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants