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’”
}
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.
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.
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).
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.