Open GyVVyG opened 2 years ago
Can you put the command "show run" in quotations like so and see if that changes:
- name: Execute show run on the switch
arubaoss_command:
commands: ['show run']
It already is ['show run']. Didn't realise I didn't put it back, i had troubles with formatting on my first try and it was screwing up there. Sorry, Edited the master post
The user you're using to login to execute the show run
command - do they have manager privileges? Are you able to ssh into the switch directly with that user and execute the same command?
The user you're using to login to execute the
show run
command - do they have manager privileges? Are you able to ssh into the switch directly with that user and execute the same command?
Yes I'm using the manager account.
I've found another solution. Looking at the arubaos_anycli.py ( https://github.com/aruba/aos-switch-ansible-collection/blob/master/plugins/modules/arubaoss_anycli.py ) It gives us another command which is
- name: View the running config in the system
arubaoss_anycli:
command: "show running-config"
Creating a playbook like this and executing it with -v will output the show running-config in base64. Not bad.
---
- hosts: all
collections:
- arubanetworks.aos_switch
tasks:
- name: View the running config in the system
arubaoss_anycli:
command: "show running-config"
edit after thinking: this is a solution to my problem but doesn't change the fact that arubaoss_command is timing out
Glad to see you have a workaround but also confusing as to why you're getting a timeout - if you're able to work with your SE we could have a debug session. The timeout would make sense if you're running a command that required interaction but that's not the case here. I haven't been able to reproduce the issue using multiple different show commands on both platforms - here's my env:
(py3_ansible) ansible-control-machine$ansible --version
ansible [core 2.12.1]
config file = /ws/chiapuzi/tme/sandbox/aoss_playbooks/aoss_example_playbooks/ansible.cfg
configured module search path = ['/users/chiapuzi/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
ansible python module location = /ws/chiapuzi/tme/sandbox/py3_ansible/lib/python3.8/site-packages/ansible
ansible collection location = /users/chiapuzi/.ansible/collections:/usr/share/ansible/collections
executable location = /ws/chiapuzi/tme/sandbox/py3_ansible/bin/ansible
python version = 3.8.9 (default, Apr 3 2021, 01:02:10) [GCC 5.4.0 20160609]
jinja version = 3.0.1
libyaml = True
That is weird if you don't have any problems but i do, that sucks. I'm having a couple of problems with another module too (arubaoss_config_bkup) so I'm wandering if i should maybe re-install everything and see if it was some kind of fluke.
ansible --version
ansible [core 2.12.2]
config file = /home/user/ansible.cfg
configured module search path = ['/home/user/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
ansible python module location = /usr/lib/python3/dist-packages/ansible
ansible collection location = /home/user/.ansible/collections:/usr/share/ansible/collections
executable location = /usr/bin/ansible
python version = 3.8.10 (default, Nov 26 2021, 20:14:08) [GCC 9.3.0]
jinja version = 2.10.1
libyaml = True
I've never done a debug session with ansible before, but if you're down to help I'm down to learn.
Hello I'm trying to show a PoC for our config management and I'm stuck on our aruba modules (everything else seems to be working OK) Enviroment:
Sample playbook from https://galaxy.ansible.com/arubanetworks/aos_switch :
with the sample inventory:
And my ansible.cfg
Executing will create the VLANs (this is good) and go to the 'show run' command and will timeout. Even if my timeout is at 30, 60 or 120 seconds ( export ANSIBLE_PERSISTENT_CONNECT_TIMEOUT=60 ). I've tried multiple commands and all cli commands gives me a timeout.
The command I'd like to execute is copy running-config tftp xxx.xx.xx.xx config.txt. Crawling the internet there seems to be multiple different version of the collection, with multiple fonctions what aren't used/support anymore so I'm struggling getting the basics down with the Aruba.
Thanks for any help