# Unable to boot aruba Switch via Ansible playbook

**URL:** <https://forum.ansible.com/t/unable-to-boot-aruba-switch-via-ansible-playbook/2615>\
**Category:** Get Help\
**Tags:** arubanetworks, playbook, collections, network\
**Created:** [November 28, 2023, 1:17pm UTC](https://forum.ansible.com/t/unable-to-boot-aruba-switch-via-ansible-playbook/2615 "2023-11-28T13:17:00Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![G24joshi](https://avatars.discourse-cdn.com/v4/letter/g/258eb7/32.png) [@G24joshi](https://forum.ansible.com/u/G24joshi)\
**Post date:** [November 28, 2023, 1:17pm UTC](https://forum.ansible.com/t/unable-to-boot-aruba-switch-via-ansible-playbook/2615/1 "2023-11-28T13:17:00Z")

</div>

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

* * *

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

---

<div class="post-metadata">

**Author:** ![G24joshi](https://avatars.discourse-cdn.com/v4/letter/g/258eb7/32.png) [@G24joshi](https://forum.ansible.com/u/G24joshi)\
**Post date:** [November 30, 2023, 11:00am UTC](https://forum.ansible.com/t/unable-to-boot-aruba-switch-via-ansible-playbook/2615/2 "2023-11-30T11:00:31Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![G24joshi](https://avatars.discourse-cdn.com/v4/letter/g/258eb7/32.png) [@G24joshi](https://forum.ansible.com/u/G24joshi)\
**Post date:** [November 30, 2023, 11:49am UTC](https://forum.ansible.com/t/unable-to-boot-aruba-switch-via-ansible-playbook/2615/3 "2023-11-30T11:49:57Z")

</div>

Hey @jbericat

How are you,

Could you please help me on this issue.

Thanks a lot!!  
Ganesh

---

<div class="post-metadata">

**Author:** ![jbericat](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/jbericat/32/627_2.png) [@jbericat](https://forum.ansible.com/u/jbericat)\
**Post date:** [November 30, 2023, 12:21pm UTC](https://forum.ansible.com/t/unable-to-boot-aruba-switch-via-ansible-playbook/2615/4 "2023-11-30T12:21:13Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![G24joshi](https://avatars.discourse-cdn.com/v4/letter/g/258eb7/32.png) [@G24joshi](https://forum.ansible.com/u/G24joshi)\
**Post date:** [November 30, 2023, 12:22pm UTC](https://forum.ansible.com/t/unable-to-boot-aruba-switch-via-ansible-playbook/2615/5 "2023-11-30T12:22:42Z")

</div>

Thanks a lot @jbericat for your kind reply.

---

<div class="post-metadata">

**Author:** ![jbericat](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/jbericat/32/627_2.png) [@jbericat](https://forum.ansible.com/u/jbericat)\
**Post date:** [December 3, 2023, 2:34am UTC](https://forum.ansible.com/t/unable-to-boot-aruba-switch-via-ansible-playbook/2615/6 "2023-12-03T02:34:43Z")

</div>

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:

> [@G24joshi](#):
>
> [root@lonans01 2930M]#

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](https://galaxy.ansible.com/ui/repo/published/arubanetworks/aos_switch/docs/).

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](https://galaxy.ansible.com/ui/repo/published/arubanetworks/aos_switch/content/module/arubaoss_reboot/).

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** :

> **[GitHub - aruba/aos-switch-ansible-collection: Ansible collection for AOS-Switch switches](https://github.com/aruba/aos-switch-ansible-collection)**
>
> Ansible collection for AOS-Switch switches

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!

---

<div class="post-metadata">

**Author:** ![G24joshi](https://avatars.discourse-cdn.com/v4/letter/g/258eb7/32.png) [@G24joshi](https://forum.ansible.com/u/G24joshi)\
**Post date:** [December 5, 2023, 10:40am UTC](https://forum.ansible.com/t/unable-to-boot-aruba-switch-via-ansible-playbook/2615/7 "2023-12-05T10:40:30Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![jbericat](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/jbericat/32/627_2.png) [@jbericat](https://forum.ansible.com/u/jbericat)\
**Post date:** [December 5, 2023, 12:14pm UTC](https://forum.ansible.com/t/unable-to-boot-aruba-switch-via-ansible-playbook/2615/8 "2023-12-05T12:14:32Z")

</div>

No worries @G24joshi I really enjoy helping-out here 😉

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 ☺ 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!
