Issue with first playbook

I have a Ubiquiti Edge Router X on my network and was playing around with running playbooks on it.

i’m trying to run the following playbook:


name: show current configuration
hosts: routers
tasks:

  • name: get facts
    edgeos_facts:
    gather_subset: all

by default (i’ve turned off strict host key checking) and run the playbook and get the following error:

root@ansible:~/My_Ansible# ansible-playbook -i router edge_facts.yml

PLAY [show current configuration] **************************************************************************************************************

TASK [Gathering Facts] *************************************************************************************************************************
ok: [EdgeRouter]

TASK [get facts] *******************************************************************************************************************************
fatal: [EdgeRouter]: FAILED! => {“changed”: false, “module_stderr”: “Shared connection to 10.1.1.1 closed.\r\n”, “module_stdout”: “Traceback (most recent call last):\r\n File "/home/USER/.ansible/tmp/ansible-tmp-1567834372.68-68684870289821/AnsiballZ_edgeos_facts.py", line 114, in \r\n _ansiballz_main()\r\n File "/home/USER/.ansible/tmp/ansible-tmp-1567834372.68-68684870289821/AnsiballZ_edgeos_facts.py", line 106, in _ansiballz_main\r\n invoke_module(zipped_mod, temp_path, ANSIBALLZ_PARAMS)\r\n File "/home/USER/.ansible/tmp/ansible-tmp-1567834372.68-68684870289821/AnsiballZ_edgeos_facts.py", line 49, in invoke_module\r\n imp.load_module(‘main’, mod, module, MOD_DESC)\r\n File "/tmp/ansible_edgeos_facts_payload_6VDe7q/main.py", line 311, in \r\n File "/tmp/ansible_edgeos_facts_payload_6VDe7q/main.py", line 299, in main\r\n File "/tmp/ansible_edgeos_facts_payload_6VDe7q/main.py", line 187, in populate\r\n File "/tmp/ansible_edgeos_facts_payload_6VDe7q/main.py", line 110, in populate\r\n File "/tmp/ansible_edgeos_facts_payload_6VDe7q/ansible_edgeos_facts_payload.zip/ansible/module_utils/network/edgeos/edgeos.py", line 74, in run_commands\r\n File "/tmp/ansible_edgeos_facts_payload_6VDe7q/ansible_edgeos_facts_payload.zip/ansible/module_utils/network/edgeos/edgeos.py", line 40, in get_connection\r\n File "/tmp/ansible_edgeos_facts_payload_6VDe7q/ansible_edgeos_facts_payload.zip/ansible/module_utils/network/edgeos/edgeos.py", line 54, in get_capabilities\r\n File "/tmp/ansible_edgeos_facts_payload_6VDe7q/ansible_edgeos_facts_payload.zip/ansible/module_utils/connection.py", line 122, in init\r\nAssertionError: socket_path must be a value\r\n”, “msg”: “MODULE FAILURE\nSee stdout/stderr for the exact error”, “rc”: 1}

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


 

 

if i run the command with -vvvv i get the following under ‘task’ : https://pastebin.com/E42YxHE0

after some googling (i’ve tried changing ControlPersist=60s doesn’t work) While looking how to make errors more readable i found something that said in ansible.cfg change stdout_callback = minimal and I actually get back the data, however it still errors out.

 

How do I make the error more readable?

Do you know what version of edgeos you are connecting to? The module docs for edgeos_facts say it was tested on 1.9.7.

It looks like the module is failing but I can’t tell why it is getting the assertion error over socket_path. I would try limiting your gather subset to see which set of facts is causing the problem you may not need them.

For making the error more readable I think the debug stdout callback will do that but I don’t think it’s going to get any more information. Unfortunately it looks like it’s a problem with the module running the target (I don’t have experience with edgeos)

I am running on build Version: v1.10.10

Here is a full debug of the connection : https://pastebin.com/Tk8B0jHH

I’ve tried just a subset of the gather_facts: config but still issue persists. Like the post says this is new so if you can recommend a resource to troubleshoot issues like this i’d be more than happy to research

I have the solution now…

you need to set the

connection: network_cliansible_network_os=edgeos