Hi Tiffany,
i was able to configure the switch to a certain extent , thanks for the support , i got suck at dsnoop:
---
-
hosts: switch1
tasks:
- name: enable dsnoop
arubaoss_dsnoop:
dsnoop: true
- name: add dsnoop authorized_server
arubaoss_dsnoop:
command: authorized_server
server_ip: "10.100.100.100"
- name: add dsnoop authorized_server
arubaoss_dsnoop:
command: authorized_server
server_ip: "10.200.200.200"
I get error: -vvv
https://github.com/aruba/aruba-ansible-modules/blob/master/module_documentation/arubaoss/arubaoss_dsnoop.md
The full traceback is:
Traceback (most recent call last):
File "/home/ansible/.ansible/tmp/ansible-tmp-1613275259.6505885-259405060885273/AnsiballZ_arubaoss_dsnoop.py", line 102, in <module>
_ansiballz_main()
File "/home/ansible/.ansible/tmp/ansible-tmp-1613275259.6505885-259405060885273/AnsiballZ_arubaoss_dsnoop.py", line 94, in _ansiballz_main
invoke_module(zipped_mod, temp_path, ANSIBALLZ_PARAMS)
File "/home/ansible/.ansible/tmp/ansible-tmp-1613275259.6505885-259405060885273/AnsiballZ_arubaoss_dsnoop.py", line 40, in invoke_module
runpy.run_module(mod_name='ansible.modules.network.arubaoss.arubaoss_dsnoop', init_globals=None, run_name='__main__', alter_sys=True)
File "/usr/lib/python3.8/runpy.py", line 207, in run_module
return _run_module_code(code, init_globals, run_name, mod_spec)
File "/usr/lib/python3.8/runpy.py", line 97, in _run_module_code
_run_code(code, mod_globals, init_globals,
File "/usr/lib/python3.8/runpy.py", line 87, in _run_code
exec(code, run_globals)
File "/tmp/ansible_arubaoss_dsnoop_payload_jwkn_249/ansible_arubaoss_dsnoop_payload.zip/ansible/modules/network/arubaoss/arubaoss_dsnoop.py", line 255, in <module>
File "/tmp/ansible_arubaoss_dsnoop_payload_jwkn_249/ansible_arubaoss_dsnoop_payload.zip/ansible/modules/network/arubaoss/arubaoss_dsnoop.py", line 251, in main
File "/tmp/ansible_arubaoss_dsnoop_payload_jwkn_249/ansible_arubaoss_dsnoop_payload.zip/ansible/modules/network/arubaoss/arubaoss_dsnoop.py", line 229, in run_module
NameError: name 'arubaoss_required_if' is not defined
fatal: [switch1]: FAILED! => {
"changed": false,
"module_stderr": "Traceback (most recent call last):\n File \"/home/ansible/.ansible/tmp/ansible-tmp-1613275259.6505885-259405060885273/AnsiballZ_arubaoss_dsnoop.py\", line 102, in <module>\n _ansiballz_main()\n File \"/home/ansible/.ansible/tmp/ansible-tmp-1613275259.6505885-259405060885273/AnsiballZ_arubaoss_dsnoop.py\", line 94, in _ansiballz_main\n invoke_module(zipped_mod, temp_path, ANSIBALLZ_PARAMS)\n File \"/home/ansible/.ansible/tmp/ansible-tmp-1613275259.6505885-259405060885273/AnsiballZ_arubaoss_dsnoop.py\", line 40, in invoke_module\n runpy.run_module(mod_name='ansible.modules.network.arubaoss.arubaoss_dsnoop', init_globals=None, run_name='__main__', alter_sys=True)\n File \"/usr/lib/python3.8/runpy.py\", line 207, in run_module\n return _run_module_code(code, init_globals, run_name, mod_spec)\n File \"/usr/lib/python3.8/runpy.py\", line 97, in _run_module_code\n _run_code(code, mod_globals, init_globals,\n File \"/usr/lib/python3.8/runpy.py\", line 87, in _run_code\n exec(code, run_globals)\n File \"/tmp/ansible_arubaoss_dsnoop_payload_jwkn_249/ansible_arubaoss_dsnoop_payload.zip/ansible/modules/network/arubaoss/arubaoss_dsnoop.py\", line 255, in <module>\n File \"/tmp/ansible_arubaoss_dsnoop_payload_jwkn_249/ansible_arubaoss_dsnoop_payload.zip/ansible/modules/network/arubaoss/arubaoss_dsnoop.py\", line 251, in main\n File \"/tmp/ansible_arubaoss_dsnoop_payload_jwkn_249/ansible_arubaoss_dsnoop_payload.zip/ansible/modules/network/arubaoss/arubaoss_dsnoop.py\", line 229, in run_module\nNameError: name 'arubaoss_required_if' is not defined\n",
"module_stdout": "",
"msg": "MODULE FAILURE\nSee stdout/stderr for the exact error",
"rc": 1
}
------------------------------
Sam DS
------------------------------
Original Message:
Sent: Feb 11, 2021 01:14 PM
From: Tiffany Chiapuzio-Wong
Subject: Ansible with ArubaOSS- Aruba 2930M -REST API Fata Error - Connection failure: Remote end closed connection without response
Hi Sam!
For AOS-Switch could you please install and use the AOS-Switch Collection ? When you run the playbook you'll have to set the proper environment variables as shown here.
You shouldn't have to change your playbook much besides ensuring you're including the collection that's described here: https://github.com/aruba/aos-switch-ansible-collection#example-playbook
The only other thing I could consider with this error, could you please verify the user you're using to login to the switch has the proper permissions to execute REST API commands? Such as TACACs or RADIUS? Please try that and let us know if you're still receiving that error!
------------------------------
Tiffany Chiapuzio-Wong
Original Message:
Sent: Feb 11, 2021 08:19 AM
From: Sam DS
Subject: Ansible with ArubaOSS- Aruba 2930M -REST API Fata Error - Connection failure: Remote end closed connection without response
Hello ,
Iam testing the ansible with arubaoss and got stuck at error related to REST API :
fatal: [switch1]: FAILED! => {"changed": false, "msg": "Connection failure: Remote end closed connection without response", "status": -1, "url": "http://10.100.100.238:80/rest/v6.0/login-sessions"}
When i tried it multiple times it worked for once using the below sample playbook and got fatal error again :
#ansible-playbook system_attributes.yml -i switch_hosts.yml
Control Machine running on Ubuntu server 20.xx
Python 3.8
Ansible 2.9.6
Aruba Switch - 2930M-48G-PoE+
Rest Interface Enabled
Error Pics:
https://drive.google.com/drive/folders/1ldfYpsqTlN0JS4IUE7brntb8wv71jCh5?usp=sharing
Iam testing sample playbooks from github
https://github.com/aruba/aruba-ansible-modules/blob/master/example_playbooks/arubaoss/vlan.yml
------------------------------
Sam DS
------------------------------