Unable to boot aruba Switch via Ansible playbook

Hi Team,

Please help to push a command “boot system flash secondary” to aruba switch.

I have to push a command “boot system flash secondary” from ansible server to aruba switch to boot aruba switch But I am unable to get this.

I write below ansible-playbook to achieve this but not getting success. Please let me know if you have any right ansible module to do this.



  • hosts: arubaswitch
    gather_facts: no
    vars:
    ansible_command_timeout: 600

    tasks:

    • name: image upload
      ansible.netcommon.cli_command:
      command: “boot system flash secondary”
      prompt: Continue (y/n)?
      answer: y
      newline: false
      prompt: Do you want to save the current configuration (y/n)?
      answer: y
      newline: false

I am getting below error after running this playbook.
The full traceback is:
File “/root/.ansible/collections/ansible_collections/ansible/netcommon/plugins/modules/cli_command.py”, line 170, in main
response = connection.get(**module.params)
File “/usr/local/lib/python3.8/site-packages/ansible/module_utils/connection.py”, line 200, in rpc
raise ConnectionError(to_text(msg, errors=‘surrogate_then_replace’), code=code)
fatal: [37.4.62.58]: FAILED! => {
“changed”: false,
“invocation”: {
“module_args”: {
“answer”: [
“y”
],
“check_all”: false,
“command”: “boot system flash secondary”,
“newline”: false,
“prompt”: [
“Do you want to save the current configuration (y/n)?”
],
“sendonly”: false
}
},
“msg”: “timeout value 600 seconds reached while trying to send command: b’boot system flash secondary’”
}

PLAY RECAP **************************************************************************************************************************************************
37.4.62.58 : ok=0 changed=0 unreachable=0 failed=1 skipped=0 rescued=0 ignored=0

Hi all,

I am still unable to reboot my aruba Switch via Ansible Playbook. can anyone please help me to know the right Ansible Module name to reboot Aruba Switch.

I have created below multiple playbooks but still no success.

2930M]# cat rebootonly3.yml

  • hosts: arubaswitch
    gather_facts: True
    vars:
    ansible_connection: network_cli
    ansible_network_os: arubanetworks.aos_switch.aoscx
    tasks:
    • name: reboot device to new image
      arubanetworks.aoscx.aoscx_command:
      commands:
      - command: ‘boot system flash secondary’
      prompt:
      - ‘.(y/n)?.
      answer:
      - y
      [root@lonans01 2930M]# cat rebootonly.yml

  • hosts: arubaswitch
    gather_facts: True
    collections:
    • arubanetworks.aos_switch
      vars:
      ansible_connection: network_cli
      tasks:
    • name: reboot device to new image
      arubaoss_reboot:
      boot_image: BI_SECONDARY_IMAGE
      is_wait: False
      [root@lonans01 2930M]#

Thanks
Ganesh

Hey @jbericat

How are you,

Could you please help me on this issue.

Thanks a lot!!
Ganesh

1 Like

Hello Ganesh, I’ll try to have a look this weekend, since right now I have to attend important personal matters. I bookmarked your post to receive a notification, so I won’t forget.

Cheers

Thanks a lot @jbericat for your kind reply.

1 Like

Hello @G24joshi,

I’ve taken a closer look at the issue you mentioned a few days ago (thanks for your patience!).

Let’s delve into it. Based on the details from your prompt:

I presume you’re working with an Aruba Switch 2900M series, is that correct?

If that’s the case, the suitable Ansible collection you should use isn’t the CX one, but rather the arubanetworks.aos_switch collection.

So, to recap:

  • You’re managing an Aruba 2930M device.
  • Your goal is to reboot it using an Ansible playbook.

In this scenario, I recommend utilizing the arubanetworks.aos_switch.arubaoss_reboot module.

Begin with this information as a starting point. If you encounter any further issues, feel free to ask, and we’ll continue assisting you.

As a final piece of advice, I strongly suggest double-checking the documentation available in the collection’s Git repository, as it contains valuable information, such as how to set up your inventory correctly:

Additionally, if you’re facing difficulties with the network_cli transport, consider exploring the REST API approach. From what I’ve gathered in the documentation, it appears to be the preferred method. However, keep in mind that this is merely my opinion, as I do not have a lot of experience in Aruba switches myself (I don’t even have any Aruba OS image on my personal GNS3 lab right now to give you a proper working example).

Hope it helps!

2 Likes

@jbericat Thanks & I appreciate the time you spent finding that information for me.

1 Like

No worries @G24joshi I really enjoy helping-out here :wink:

As a side note, and If it’s not asking too much, could you be so kind to apply proper formatting to the code snippets on your posts, please? It may sound kind-of silly, but that improves readability a ton, and helps other forum users to find solutions related to their own issues & doubts. Also, if you feel that the info I provided was enough to dissipate your doubts, ticking the solved check would make my day also :smiling_face: Nonetheless, if it wasn’t, just tell me and I’ll try to get my hands on an Aruba OS image to help you further.

Take care and see you around mate!

1 Like