# frr\_facts and/or frr\_bgp give assertionError?

**URL:** <https://forum.ansible.com/t/frr-facts-and-or-frr-bgp-give-assertionerror/30653>\
**Category:** Ansible Project\
**Created:** [June 25, 2019, 9:48pm UTC](https://forum.ansible.com/t/frr-facts-and-or-frr-bgp-give-assertionerror/30653 "2019-06-25T21:48:40Z")\
**Posts on this page:** 14\
**Page:** 1

<div class="post-metadata">

**Author:** ![Piet\_Honkoop](https://avatars.discourse-cdn.com/v4/letter/p/f6c823/32.png) [@Piet\_Honkoop](https://forum.ansible.com/u/Piet_Honkoop)\
**Post date:** [June 25, 2019, 9:48pm UTC](https://forum.ansible.com/t/frr-facts-and-or-frr-bgp-give-assertionerror/30653/1 "2019-06-25T21:48:40Z")

</div>

Trying to explore the possibilities of frr\_bgp module.

If I try a task like:

tasks:

- name: Get setup frr  
frr\_facts:  
gather\_subset: all

That results in:

File "/tmp/ansible\_frr\_facts\_payload\_UFKM\_S/ansible\_frr\_facts\_payload.zip/ansible/module\_utils/connection.py", line 125, in **init** \r\nAssertionError: socket\_path must be a value

How can I fix this?

Thanks,  
Piet

---

<div class="post-metadata">

**Author:** ![Chiu\_Hsia\_Peng](https://avatars.discourse-cdn.com/v4/letter/c/e0b2c6/32.png) [@Chiu\_Hsia\_Peng](https://forum.ansible.com/u/Chiu_Hsia_Peng)\
**Post date:** [June 26, 2019, 2:07am UTC](https://forum.ansible.com/t/frr-facts-and-or-frr-bgp-give-assertionerror/30653/2 "2019-06-26T02:07:44Z")

</div>

What ansible\_connection are you using?  
I encountered a similar problem when ansible\_connection is set to local.

1. I solved the problem by setting ansible\_connection to network\_cli

2. adding frr to lib/ansible/config/base.yml also can solve the problem (ansible\_connection is set to local)  
i.e.

NETWORK\_GROUP\_MODULES:  
name: Network module families  
default: […, frr]

sincerely,  
Jane#

Piet Honkoop於 2019年6月26日星期三 UTC+8上午5時48分40秒寫道：

---

<div class="post-metadata">

**Author:** ![Piet\_Honkoop](https://avatars.discourse-cdn.com/v4/letter/p/f6c823/32.png) [@Piet\_Honkoop](https://forum.ansible.com/u/Piet_Honkoop)\
**Post date:** [June 26, 2019, 8:28am UTC](https://forum.ansible.com/t/frr-facts-and-or-frr-bgp-give-assertionerror/30653/3 "2019-06-26T08:28:43Z")

</div>

Hi Jane,  
Thanks for the reply. Alas, it didn’t work 🙂

A bit more on the environment I’m working with:

Got a lab setup with ubuntu 18.04 VMs with FRR 7.0 installed.

What I want to test is whether I can properly configure frr on there with ansible.

so the regular network\_cli connection is likely not to work.

What confuses me is that the AssertionError seems to point to config error in the connection module (it calls Connection(module.socket\_path) but socket\_path is Null. The socket\_path should be set somewhere, I just can’t seem to find where ☹

Any ideas?

Thanks,  
Piet

---

<div class="post-metadata">

**Author:** ![Chiu\_Hsia\_Peng](https://avatars.discourse-cdn.com/v4/letter/c/e0b2c6/32.png) [@Chiu\_Hsia\_Peng](https://forum.ansible.com/u/Chiu_Hsia_Peng)\
**Post date:** [June 26, 2019, 10:44am UTC](https://forum.ansible.com/t/frr-facts-and-or-frr-bgp-give-assertionerror/30653/4 "2019-06-26T10:44:44Z")

</div>

Hi,  
I noticed there is no frr.py at lib/ansible/plugins/action.

What’s the ansible\_network\_os ?

In my case (my customized network device, qnos) , I need add

NETWORK\_GROUP\_MODULES:

name: Network module families

default: […, qnos]

In this case, my ansible\_network\_os=qnos

And the socket\_path is set at the run() at lib/ansible/plugins/action/qnos.py.  
You can refer to the lib/ansible/plugins/action/ios.py or the corresponding ansible\_network\_os file.

sincerely,  
Jane#

Piet Honkoop於 2019年6月26日星期三 UTC+8下午4時28分43秒寫道：

---

<div class="post-metadata">

**Author:** ![Piet\_Honkoop](https://avatars.discourse-cdn.com/v4/letter/p/f6c823/32.png) [@Piet\_Honkoop](https://forum.ansible.com/u/Piet_Honkoop)\
**Post date:** [June 26, 2019, 11:34am UTC](https://forum.ansible.com/t/frr-facts-and-or-frr-bgp-give-assertionerror/30653/5 "2019-06-26T11:34:56Z")

</div>

Hi,

ansible\_network\_os is not set.

As indicated: this is a ubuntu vm with frr installed in it, so ansible does not really recognize a network\_os variant.

so it might be that frr\_bgp can only be used on certain device types?

For now, I’m going to try another way of generating the proper configuration.

I’ve tried this on cumulus switches as well, network\_os is unset there too.

Thanks,  
Piet

---

<div class="post-metadata">

**Author:** ![ganeshrn](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/ganeshrn/32/1021_2.png) [@ganeshrn](https://forum.ansible.com/u/ganeshrn)\
**Post date:** [June 26, 2019, 11:54am UTC](https://forum.ansible.com/t/frr-facts-and-or-frr-bgp-give-assertionerror/30653/6 "2019-06-26T11:54:23Z")

</div>

Please try setting below variables in inventory file:ansible\_network\_os=frr ansible\_connection=network\_cli

network\_cli uses persistent connection and the value \_socket\_path is set after the connection with the remote host is successful in [task\_executor](https://github.com/ansible/ansible/blob/devel/lib/ansible/executor/task_executor.py#L921)  
Also, frr action plugin is not required for connection=network\_cli

---

<div class="post-metadata">

**Author:** ![nchakrab](https://avatars.discourse-cdn.com/v4/letter/n/919ad9/32.png) [@nchakrab](https://forum.ansible.com/u/nchakrab)\
**Post date:** [June 26, 2019, 11:59am UTC](https://forum.ansible.com/t/frr-facts-and-or-frr-bgp-give-assertionerror/30653/7 "2019-06-26T11:59:38Z")

</div>

Hello,

For managing FRR using Ansible, you’d need to a have service account with the default shell set to /bin/vtysh on the VM/bare-metal server on which you’ve deployed FRR and use that service account credentials in your group\_vars/host\_vars. Essentially, if you SSH directly into your VMs using that service account, you should drop directly to the FRR shell.

You would also need to set ansible\_network\_os: frr and ansible\_connection: network\_cli

Thanks!

---

<div class="post-metadata">

**Author:** ![Piet\_Honkoop](https://avatars.discourse-cdn.com/v4/letter/p/f6c823/32.png) [@Piet\_Honkoop](https://forum.ansible.com/u/Piet_Honkoop)\
**Post date:** [June 27, 2019, 9:24am UTC](https://forum.ansible.com/t/frr-facts-and-or-frr-bgp-give-assertionerror/30653/8 "2019-06-27T09:24:03Z")

</div>

Hi Nilashish,

Thanks!  
Helps a few good steps, but I’m still running into a wall ;(

Got this in group\_vars/routers:

ansible\_network\_os: frr  
ansible\_connection: network\_cli  
ansible\_user: frradmin

playbook router\_config:

---

<div class="post-metadata">

**Author:** ![nchakrab](https://avatars.discourse-cdn.com/v4/letter/n/919ad9/32.png) [@nchakrab](https://forum.ansible.com/u/nchakrab)\
**Post date:** [June 27, 2019, 9:41am UTC](https://forum.ansible.com/t/frr-facts-and-or-frr-bgp-give-assertionerror/30653/9 "2019-06-27T09:41:15Z")

</div>

Hi Piet,

Could you try setting ‘ansible\_python\_interpreter’ value to point to the python executable on your controller node and check if it works?

Refer: [https://docs.ansible.com/ansible/latest/user\_guide/intro\_inventory.html](https://docs.ansible.com/ansible/latest/user_guide/intro_inventory.html) (search for ansible\_python\_interpreter)

Thanks!

---

<div class="post-metadata">

**Author:** ![Piet\_Honkoop](https://avatars.discourse-cdn.com/v4/letter/p/f6c823/32.png) [@Piet\_Honkoop](https://forum.ansible.com/u/Piet_Honkoop)\
**Post date:** [June 27, 2019, 10:09am UTC](https://forum.ansible.com/t/frr-facts-and-or-frr-bgp-give-assertionerror/30653/10 "2019-06-27T10:09:35Z")

</div>

That does the trick!

Thanks 😉

Piet

---

<div class="post-metadata">

**Author:** ![mayape\_mayape](https://avatars.discourse-cdn.com/v4/letter/m/848f3c/32.png) [@mayape\_mayape](https://forum.ansible.com/u/mayape_mayape)\
**Post date:** [April 27, 2020, 9:33am UTC](https://forum.ansible.com/t/frr-facts-and-or-frr-bgp-give-assertionerror/30653/11 "2020-04-27T09:33:22Z")

</div>

Hi all,  
I’m having the same problem. Tried everything suggested here, but no luck…

This is the error message I keep receiving:

ansible-playbook 2.9.7

config file = /home/maya/ansible/ansible.cfg  
configured module search path = [‘/root/.ansible/plugins/modules’, ‘/usr/share/ansible/plugins/modules’]  
ansible python module location = /usr/local/lib/python3.6/dist-packages/ansible  
executable location = /usr/local/bin/ansible-playbook  
python version = 3.6.9 (default, Apr 18 2020, 01:56:04) [GCC 8.4.0]  
Using /home/maya/ansible/ansible.cfg as config file  
setting up inventory plugins  
host\_list declined parsing /home/maya/ansible/hosts as it did not pass its verify\_file() method  
script declined parsing /home/maya/ansible/hosts as it did not pass its verify\_file() method  
auto declined parsing /home/maya/ansible/hosts as it did not pass its verify\_file() method  
toml declined parsing /home/maya/ansible/hosts as it did not pass its verify\_file() method  
[WARNING]: \* Failed to parse /home/maya/ansible/hosts with yaml plugin: Syntax Error while loading YAML. did not find expected The error appears to be in ‘/home/maya/ansible/hosts’:  
line 2, column 1, but may be elsewhere in the file depending on the exact syntax problem. The offending line appears to be: [frr] cumulus01 ansible\_python\_interpreter=/usr/bin/python ^ here  
File “/usr/local/lib/python3.6/dist-packages/ansible/inventory/manager.py”, line 280, in parse\_source  
plugin.parse(self.\_inventory, self.\_loader, source, cache=cache)  
File “/usr/local/lib/python3.6/dist-packages/ansible/plugins/inventory/yaml.py”, line 105, in parse  
raise AnsibleParserError(e)  
[WARNING]: \* Failed to parse /home/maya/ansible/hosts with ini plugin: /home/maya/ansible/hosts:6: Expected key=value, got: ansible\_network\_os: frr  
File “/usr/local/lib/python3.6/dist-packages/ansible/inventory/manager.py”, line 280, in parse\_source  
plugin.parse(self.\_inventory, self.\_loader, source, cache=cache)  
File “/usr/local/lib/python3.6/dist-packages/ansible/plugins/inventory/ini.py”, line 138, in parse  
raise AnsibleParserError(e)  
[WARNING]: Unable to parse /home/maya/ansible/hosts as an inventory source  
[WARNING]: No inventory was parsed, only implicit localhost is available  
[WARNING]: provided hosts list is empty, only localhost is available. Note that the implicit localhost does not match ‘all’  
Loading callback plugin default of type stdout, v2.0 from /usr/local/lib/python3.6/dist-packages/ansible/plugins/callback/default.py

PLAYBOOK: demo.yml \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*  
Positional arguments: demo.yml  
verbosity: 4  
connection: smart  
timeout: 10  
become\_method: sudo  
tags: (‘all’,)  
inventory: (‘/home/maya/ansible/hosts’,)  
forks: 5  
1 plays in demo.yml

PLAY [frr] \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*  
META: ran handlers

TASK [get facts of router] \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*  
task path: /home/maya/ansible/demo.yml:6  
 ESTABLISH SSH CONNECTION FOR USER: root  
 SSH: EXEC sshpass -d10 ssh -vvv -C -o ControlMaster=auto -o ControlPersist=60s -o StrictHostKeyChecking=no -o ‘User=“root”’ -o ConnectTimeout=10 -o ServerAliveInterval=50 -o ConnectTimeout=60 -o ControlPath=/root/.ansible/cp/82731db24e cumulus01 ‘/bin/sh -c ‘"’“‘echo ~root && sleep 0’”’“‘’  
 (0, b’/root\n’, b’OpenSSH\_7.6p1 Ubuntu-4ubuntu0.3, OpenSSL 1.0.2n 7 Dec 2017\r\ndebug1: Reading configuration data /etc/ssh/ssh\_config\r\ndebug1: /etc/ssh/ssh\_config line 19: Applying options for \*\r\ndebug1: auto-mux: Trying existing master\r\ndebug2: fd 3 setting O\_NONBLOCK\r\ndebug2: mux\_client\_hello\_exchange: master version 4\r\ndebug3: mux\_client\_forwards: request forwardings: 0 local, 0 remote\r\ndebug3: mux\_client\_request\_session: entering\r\ndebug3: mux\_client\_request\_alive: entering\r\ndebug3: mux\_client\_request\_alive: done pid = 29715\r\ndebug3: mux\_client\_request\_session: session request sent\r\ndebug1: mux\_client\_request\_session: master session id: 2\r\ndebug3: mux\_client\_read\_packet: read header failed: Broken pipe\r\ndebug2: Received exit status from master 0\r\n’)  
 ESTABLISH SSH CONNECTION FOR USER: root  
 SSH: EXEC sshpass -d10 ssh -vvv -C -o ControlMaster=auto -o ControlPersist=60s -o StrictHostKeyChecking=no -o ‘User=“root”’ -o ConnectTimeout=10 -o ServerAliveInterval=50 -o ConnectTimeout=60 -o ControlPath=/root/.ansible/cp/82731db24e cumulus01 '/bin/sh -c '”‘"’( umask 77 && mkdir -p “`echo /root/.ansible/tmp`”&& mkdir /root/.ansible/tmp/ansible-tmp-1587979362.872172-30103-226666053895537 && echo ansible-tmp-1587979362.872172-30103-226666053895537=“`echo /root/.ansible/tmp/ansible-tmp-1587979362.872172-30103-226666053895537`” ) && sleep 0’“'”‘’  
 (0, b’ansible-tmp-1587979362.872172-30103-226666053895537=/root/.ansible/tmp/ansible-tmp-1587979362.872172-30103-226666053895537\n’, b’OpenSSH\_7.6p1 Ubuntu-4ubuntu0.3, OpenSSL 1.0.2n 7 Dec 2017\r\ndebug1: Reading configuration data /etc/ssh/ssh\_config\r\ndebug1: /etc/ssh/ssh\_config line 19: Applying options for \*\r\ndebug1: auto-mux: Trying existing master\r\ndebug2: fd 3 setting O\_NONBLOCK\r\ndebug2: mux\_client\_hello\_exchange: master version 4\r\ndebug3: mux\_client\_forwards: request forwardings: 0 local, 0 remote\r\ndebug3: mux\_client\_request\_session: entering\r\ndebug3: mux\_client\_request\_alive: entering\r\ndebug3: mux\_client\_request\_alive: done pid = 29715\r\ndebug3: mux\_client\_request\_session: session request sent\r\ndebug1: mux\_client\_request\_session: master session id: 2\r\ndebug3: mux\_client\_read\_packet: read header failed: Broken pipe\r\ndebug2: Received exit status from master 0\r\n’)  
Using module file /usr/local/lib/python3.6/dist-packages/ansible/modules/network/frr/frr\_facts.py  
 PUT /root/.ansible/tmp/ansible-local-30090g37q3d\_u/tmp86tlvxi7 TO /root/.ansible/tmp/ansible-tmp-1587979362.872172-30103-226666053895537/AnsiballZ\_frr\_facts.py  
 SSH: EXEC sshpass -d10 sftp -o BatchMode=no -b - -vvv -C -o ControlMaster=auto -o ControlPersist=60s -o StrictHostKeyChecking=no -o ‘User=“root”’ -o ConnectTimeout=10 -o ServerAliveInterval=50 -o ConnectTimeout=60 -o ControlPath=/root/.ansible/cp/82731db24e ‘[cumulus01]’  
 (0, b’sftp\> put /root/.ansible/tmp/ansible-local-30090g37q3d\_u/tmp86tlvxi7 /root/.ansible/tmp/ansible-tmp-1587979362.872172-30103-226666053895537/AnsiballZ\_frr\_facts.py\n’, b’OpenSSH\_7.6p1 Ubuntu-4ubuntu0.3, OpenSSL 1.0.2n 7 Dec 2017\r\ndebug1: Reading configuration data /etc/ssh/ssh\_config\r\ndebug1: /etc/ssh/ssh\_config line 19: Applying options for \*\r\ndebug1: auto-mux: Trying existing master\r\ndebug2: fd 3 setting O\_NONBLOCK\r\ndebug2: mux\_client\_hello\_exchange: master version 4\r\ndebug3: mux\_client\_forwards: request forwardings: 0 local, 0 remote\r\ndebug3: mux\_client\_request\_session: entering\r\ndebug3: mux\_client\_request\_alive: entering\r\ndebug3: mux\_client\_request\_alive: done pid = 29715\r\ndebug3: mux\_client\_request\_session: session request sent\r\ndebug1: mux\_client\_request\_session: master session id: 2\r\ndebug2: Remote version: 3\r\ndebug2: Server supports extension “[posix-rename@openssh.com](mailto:posix-rename@openssh.com)” revision 1\r\ndebug2: Server supports extension “[statvfs@openssh.com](mailto:statvfs@openssh.com)” revision 2\r\ndebug2: Server supports extension “[fstatvfs@openssh.com](mailto:fstatvfs@openssh.com)” revision 2\r\ndebug2: Server supports extension “[hardlink@openssh.com](mailto:hardlink@openssh.com)” revision 1\r\ndebug2: Server supports extension “[fsync@openssh.com](mailto:fsync@openssh.com)” revision 1\r\ndebug3: Sent message fd 3 T:16 I:1\r\ndebug3: SSH\_FXP\_REALPATH . → /root size 0\r\ndebug3: Looking up /root/.ansible/tmp/ansible-local-30090g37q3d\_u/tmp86tlvxi7\r\ndebug3: Sent message fd 3 T:17 I:2\r\ndebug3: Received stat reply T:101 I:2\r\ndebug1: Couldn't stat remote file: No such file or directory\r\ndebug3: Sent message SSH2\_FXP\_OPEN I:3 P:/root/.ansible/tmp/ansible-tmp-1587979362.872172-30103-226666053895537/AnsiballZ\_frr\_facts.py\r\ndebug3: Sent message SSH2\_FXP\_WRITE I:4 O:0 S:32768\r\ndebug3: SSH2\_FXP\_STATUS 0\r\ndebug3: In write loop, ack for 4 32768 bytes at 0\r\ndebug3: Sent message SSH2\_FXP\_WRITE I:5 O:32768 S:32768\r\ndebug3: Sent message SSH2\_FXP\_WRITE I:6 O:65536 S:32768\r\ndebug3: Sent message SSH2\_FXP\_WRITE I:7 O:98304 S:16029\r\ndebug3: SSH2\_FXP\_STATUS 0\r\ndebug3: In write loop, ack for 5 32768 bytes at 32768\r\ndebug3: SSH2\_FXP\_STATUS 0\r\ndebug3: In write loop, ack for 6 32768 bytes at 65536\r\ndebug3: SSH2\_FXP\_STATUS 0\r\ndebug3: In write loop, ack for 7 16029 bytes at 98304\r\ndebug3: Sent message SSH2\_FXP\_CLOSE I:4\r\ndebug3: SSH2\_FXP\_STATUS 0\r\ndebug3: mux\_client\_read\_packet: read header failed: Broken pipe\r\ndebug2: Received exit status from master 0\r\n’)  
 ESTABLISH SSH CONNECTION FOR USER: root  
 SSH: EXEC sshpass -d10 ssh -vvv -C -o ControlMaster=auto -o ControlPersist=60s -o StrictHostKeyChecking=no -o ‘User=“root”’ -o ConnectTimeout=10 -o ServerAliveInterval=50 -o ConnectTimeout=60 -o ControlPath=/root/.ansible/cp/82731db24e cumulus01 ‘/bin/sh -c ‘"’“‘chmod u+x /root/.ansible/tmp/ansible-tmp-1587979362.872172-30103-226666053895537/ /root/.ansible/tmp/ansible-tmp-1587979362.872172-30103-226666053895537/AnsiballZ\_frr\_facts.py && sleep 0’”’“‘’  
 (0, b’‘, b’OpenSSH\_7.6p1 Ubuntu-4ubuntu0.3, OpenSSL 1.0.2n 7 Dec 2017\r\ndebug1: Reading configuration data /etc/ssh/ssh\_config\r\ndebug1: /etc/ssh/ssh\_config line 19: Applying options for \*\r\ndebug1: auto-mux: Trying existing master\r\ndebug2: fd 3 setting O\_NONBLOCK\r\ndebug2: mux\_client\_hello\_exchange: master version 4\r\ndebug3: mux\_client\_forwards: request forwardings: 0 local, 0 remote\r\ndebug3: mux\_client\_request\_session: entering\r\ndebug3: mux\_client\_request\_alive: entering\r\ndebug3: mux\_client\_request\_alive: done pid = 29715\r\ndebug3: mux\_client\_request\_session: session request sent\r\ndebug1: mux\_client\_request\_session: master session id: 2\r\ndebug3: mux\_client\_read\_packet: read header failed: Broken pipe\r\ndebug2: Received exit status from master 0\r\n’)  
 ESTABLISH SSH CONNECTION FOR USER: root  
 SSH: EXEC sshpass -d10 ssh -vvv -C -o ControlMaster=auto -o ControlPersist=60s -o StrictHostKeyChecking=no -o ‘User=“root”’ -o ConnectTimeout=10 -o ServerAliveInterval=50 -o ConnectTimeout=60 -o ControlPath=/root/.ansible/cp/82731db24e -tt cumulus01 '/bin/sh -c '”‘"’/usr/bin/python /root/.ansible/tmp/ansible-tmp-1587979362.872172-30103-226666053895537/AnsiballZ\_frr\_facts.py && sleep 0’“'”‘’  
 (1, b’Traceback (most recent call last):\r\n File “/root/.ansible/tmp/ansible-tmp-1587979362.872172-30103-226666053895537/AnsiballZ\_frr\_facts.py”, line 102, in \r\n \_ansiballz\_main()\r\n File “/root/.ansible/tmp/ansible-tmp-1587979362.872172-30103-226666053895537/AnsiballZ\_frr\_facts.py”, line 94, in \_ansiballz\_main\r\n invoke\_module(zipped\_mod, temp\_path, ANSIBALLZ\_PARAMS)\r\n File “/root/.ansible/tmp/ansible-tmp-1587979362.872172-30103-226666053895537/AnsiballZ\_frr\_facts.py”, line 40, in invoke\_module\r\n runpy.run\_module(mod\_name='ansible.modules.network.frr.frr\_facts', init\_globals=None, run\_name=' **main**', alter\_sys=True)\r\n File “/usr/lib/python2.7/runpy.py”, line 188, in run\_module\r\n fname, loader, pkg\_name)\r\n File “/usr/lib/python2.7/runpy.py”, line 82, in \_run\_module\_code\r\n mod\_name, mod\_fname, mod\_loader, pkg\_name)\r\n File “/usr/lib/python2.7/runpy.py”, line 72, in \_run\_code\r\n exec code in run\_globals\r\n File “/tmp/ansible\_frr\_facts\_payload\_A4wJUl/ansible\_frr\_facts\_payload.zip/ansible/modules/network/frr/frr\_facts.py”, line 412, in \r\n File “/tmp/ansible\_frr\_facts\_payload\_A4wJUl/ansible\_frr\_facts\_payload.zip/ansible/modules/network/frr/frr\_facts.py”, line 397, in main\r\n File “/tmp/ansible\_frr\_facts\_payload\_A4wJUl/ansible\_frr\_facts\_payload.zip/ansible/modules/network/frr/frr\_facts.py”, line 135, in **init** \r\n File “/tmp/ansible\_frr\_facts\_payload\_A4wJUl/ansible\_frr\_facts\_payload.zip/ansible/module\_utils/network/frr/frr.py”, line 14, in get\_capabilities\r\n File “/tmp/ansible\_frr\_facts\_payload\_A4wJUl/ansible\_frr\_facts\_payload.zip/ansible/module\_utils/connection.py”, line 121, in **init** \r\nAssertionError: socket\_path must be a value\r\n’, b’OpenSSH\_7.6p1 Ubuntu-4ubuntu0.3, OpenSSL 1.0.2n 7 Dec 2017\r\ndebug1: Reading configuration data /etc/ssh/ssh\_config\r\ndebug1: /etc/ssh/ssh\_config line 19: Applying options for \*\r\ndebug1: auto-mux: Trying existing master\r\ndebug2: fd 3 setting O\_NONBLOCK\r\ndebug2: mux\_client\_hello\_exchange: master version 4\r\ndebug3: mux\_client\_forwards: request forwardings: 0 local, 0 remote\r\ndebug3: mux\_client\_request\_session: entering\r\ndebug3: mux\_client\_request\_alive: entering\r\ndebug3: mux\_client\_request\_alive: done pid = 29715\r\ndebug3: mux\_client\_request\_session: session request sent\r\ndebug1: mux\_client\_request\_session: master session id: 2\r\ndebug3: mux\_client\_read\_packet: read header failed: Broken pipe\r\ndebug2: Received exit status from master 1\r\nShared connection to cumulus01 closed.\r\n’)  
 Failed to connect to the host via ssh: OpenSSH\_7.6p1 Ubuntu-4ubuntu0.3, OpenSSL 1.0.2n 7 Dec 2017  
debug1: Reading configuration data /etc/ssh/ssh\_config  
debug1: /etc/ssh/ssh\_config line 19: Applying options for \*  
debug1: auto-mux: Trying existing master  
debug2: fd 3 setting O\_NONBLOCK  
debug2: mux\_client\_hello\_exchange: master version 4  
debug3: mux\_client\_forwards: request forwardings: 0 local, 0 remote  
debug3: mux\_client\_request\_session: entering  
debug3: mux\_client\_request\_alive: entering  
debug3: mux\_client\_request\_alive: done pid = 29715  
debug3: mux\_client\_request\_session: session request sent  
debug1: mux\_client\_request\_session: master session id: 2  
debug3: mux\_client\_read\_packet: read header failed: Broken pipe  
debug2: Received exit status from master 1  
Shared connection to cumulus01 closed.  
 ESTABLISH SSH CONNECTION FOR USER: root  
 SSH: EXEC sshpass -d10 ssh -vvv -C -o ControlMaster=auto -o ControlPersist=60s -o StrictHostKeyChecking=no -o ‘User=“root”’ -o ConnectTimeout=10 -o ServerAliveInterval=50 -o ConnectTimeout=60 -o ControlPath=/root/.ansible/cp/82731db24e cumulus01 ‘/bin/sh -c ‘"’“‘rm -f -r /root/.ansible/tmp/ansible-tmp-1587979362.872172-30103-226666053895537/ \> /dev/null 2\>&1 && sleep 0’”’"‘’  
 (0, b’‘, b’OpenSSH\_7.6p1 Ubuntu-4ubuntu0.3, OpenSSL 1.0.2n 7 Dec 2017\r\ndebug1: Reading configuration data /etc/ssh/ssh\_config\r\ndebug1: /etc/ssh/ssh\_config line 19: Applying options for \*\r\ndebug1: auto-mux: Trying existing master\r\ndebug2: fd 3 setting O\_NONBLOCK\r\ndebug2: mux\_client\_hello\_exchange: master version 4\r\ndebug3: mux\_client\_forwards: request forwardings: 0 local, 0 remote\r\ndebug3: mux\_client\_request\_session: entering\r\ndebug3: mux\_client\_request\_alive: entering\r\ndebug3: mux\_client\_request\_alive: done pid = 29715\r\ndebug3: mux\_client\_request\_session: session request sent\r\ndebug1: mux\_client\_request\_session: master session id: 2\r\ndebug3: mux\_client\_read\_packet: read header failed: Broken pipe\r\ndebug2: Received exit status from master 0\r\n’)  
The full traceback is:  
Traceback (most recent call last):  
File “/root/.ansible/tmp/ansible-tmp-1587979362.872172-30103-226666053895537/AnsiballZ\_frr\_facts.py”, line 102, in   
\_ansiballz\_main()  
File “/root/.ansible/tmp/ansible-tmp-1587979362.872172-30103-226666053895537/AnsiballZ\_frr\_facts.py”, line 94, in \_ansiballz\_main  
invoke\_module(zipped\_mod, temp\_path, ANSIBALLZ\_PARAMS)  
File “/root/.ansible/tmp/ansible-tmp-1587979362.872172-30103-226666053895537/AnsiballZ\_frr\_facts.py”, line 40, in invoke\_module  
runpy.run\_module(mod\_name=‘ansible.modules.network.frr.frr\_facts’, init\_globals=None, run\_name=‘ **main** ’, alter\_sys=True)  
File “/usr/lib/python2.7/runpy.py”, line 188, in run\_module  
fname, loader, pkg\_name)  
File “/usr/lib/python2.7/runpy.py”, line 82, in \_run\_module\_code  
mod\_name, mod\_fname, mod\_loader, pkg\_name)  
File “/usr/lib/python2.7/runpy.py”, line 72, in \_run\_code  
exec code in run\_globals  
File “/tmp/ansible\_frr\_facts\_payload\_A4wJUl/ansible\_frr\_facts\_payload.zip/ansible/modules/network/frr/frr\_facts.py”, line 412, in   
File “/tmp/ansible\_frr\_facts\_payload\_A4wJUl/ansible\_frr\_facts\_payload.zip/ansible/modules/network/frr/frr\_facts.py”, line 397, in main  
File “/tmp/ansible\_frr\_facts\_payload\_A4wJUl/ansible\_frr\_facts\_payload.zip/ansible/modules/network/frr/frr\_facts.py”, line 135, in **init**  
File “/tmp/ansible\_frr\_facts\_payload\_A4wJUl/ansible\_frr\_facts\_payload.zip/ansible/module\_utils/network/frr/frr.py”, line 14, in get\_capabilities  
File “/tmp/ansible\_frr\_facts\_payload\_A4wJUl/ansible\_frr\_facts\_payload.zip/ansible/module\_utils/connection.py”, line 121, in **init**  
AssertionError: socket\_path must be a value  
fatal: [cumulus01]: FAILED! =\> {  
“changed”: false,  
“module\_stderr”: “OpenSSH\_7.6p1 Ubuntu-4ubuntu0.3, OpenSSL 1.0.2n 7 Dec 2017\r\ndebug1: Reading configuration data /etc/ssh/ssh\_config\r\ndebug1: /etc/ssh/ssh\_config line 19: Applying options for \*\r\ndebug1: auto-mux: Trying existing master\r\ndebug2: fd 3 setting O\_NONBLOCK\r\ndebug2: mux\_client\_hello\_exchange: master version 4\r\ndebug3: mux\_client\_forwards: request forwardings: 0 local, 0 remote\r\ndebug3: mux\_client\_request\_session: entering\r\ndebug3: mux\_client\_request\_alive: entering\r\ndebug3: mux\_client\_request\_alive: done pid = 29715\r\ndebug3: mux\_client\_request\_session: session request sent\r\ndebug1: mux\_client\_request\_session: master session id: 2\r\ndebug3: mux\_client\_read\_packet: read header failed: Broken pipe\r\ndebug2: Received exit status from master 1\r\nShared connection to cumulus01 closed.\r\n”,  
“module\_stdout”: “Traceback (most recent call last):\r\n File "/root/.ansible/tmp/ansible-tmp-1587979362.872172-30103-226666053895537/AnsiballZ\_frr\_facts.py", line 102, in \r\n \_ansiballz\_main()\r\n File "/root/.ansible/tmp/ansible-tmp-1587979362.872172-30103-226666053895537/AnsiballZ\_frr\_facts.py", line 94, in \_ansiballz\_main\r\n invoke\_module(zipped\_mod, temp\_path, ANSIBALLZ\_PARAMS)\r\n File "/root/.ansible/tmp/ansible-tmp-1587979362.872172-30103-226666053895537/AnsiballZ\_frr\_facts.py", line 40, in invoke\_module\r\n runpy.run\_module(mod\_name=‘ansible.modules.network.frr.frr\_facts’, init\_globals=None, run\_name=‘ **main** ’, alter\_sys=True)\r\n File "/usr/lib/python2.7/runpy.py", line 188, in run\_module\r\n fname, loader, pkg\_name)\r\n File "/usr/lib/python2.7/runpy.py", line 82, in \_run\_module\_code\r\n mod\_name, mod\_fname, mod\_loader, pkg\_name)\r\n File "/usr/lib/python2.7/runpy.py", line 72, in \_run\_code\r\n exec code in run\_globals\r\n File "/tmp/ansible\_frr\_facts\_payload\_A4wJUl/ansible\_frr\_facts\_payload.zip/ansible/modules/network/frr/frr\_facts.py", line 412, in \r\n File "/tmp/ansible\_frr\_facts\_payload\_A4wJUl/ansible\_frr\_facts\_payload.zip/ansible/modules/network/frr/frr\_facts.py", line 397, in main\r\n File "/tmp/ansible\_frr\_facts\_payload\_A4wJUl/ansible\_frr\_facts\_payload.zip/ansible/modules/network/frr/frr\_facts.py", line 135, in **init** \r\n File "/tmp/ansible\_frr\_facts\_payload\_A4wJUl/ansible\_frr\_facts\_payload.zip/ansible/module\_utils/network/frr/frr.py", line 14, in get\_capabilities\r\n File "/tmp/ansible\_frr\_facts\_payload\_A4wJUl/ansible\_frr\_facts\_payload.zip/ansible/module\_utils/connection.py", line 121, 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 \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*  
cumulus01 : ok=0 changed=0 unreachable=0 failed=1 skipped=0 rescued=0 ignored=0

root@maya-VirtualBox:/home/maya/ansible# ansible-playbook demo.yml -vvvv

**This is the playbook demo.yml:**

- hosts: frr  
gather\_facts: false

tasks:

- name: get facts of router  
frr\_facts:  
gather\_subset:
- all

**And this is the hosts file:**

[frr]  
cumulus01 ansible\_python\_interpreter=/usr/bin/python

[all:vars]  
ansible\_user=cumulus  
ansible\_network\_os: frr  
ansible\_connection: network\_cli

[local]  
localhost ansible\_python\_interpreter=/usr/bin/python3.6

Tried to make something simple here to isolate the root cause, but I ran out of ideas.  
cumulus user’s shell is the vtysh shell, as Nilashish Chakraborty suggested it should be.

What am I doing wrong?

Thanks in advance,  
Maya.

---

<div class="post-metadata">

**Author:** ![racke](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/racke/32/4767_2.png) [@racke](https://forum.ansible.com/u/racke)\
**Post date:** [April 27, 2020, 9:36am UTC](https://forum.ansible.com/t/frr-facts-and-or-frr-bgp-give-assertionerror/30653/12 "2020-04-27T09:36:11Z")

</div>

> Hi all,  
> I'm having the same problem. Tried everything suggested here, but no luck...

What about fixing all the inventory warnings first?

Regards  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Racke

---

<div class="post-metadata">

**Author:** ![mayape\_mayape](https://avatars.discourse-cdn.com/v4/letter/m/848f3c/32.png) [@mayape\_mayape](https://forum.ansible.com/u/mayape_mayape)\
**Post date:** [April 27, 2020, 10:40am UTC](https://forum.ansible.com/t/frr-facts-and-or-frr-bgp-give-assertionerror/30653/13 "2020-04-27T10:40:35Z")

</div>

Hi,  
Thanks for the quick response.

Fixed the warning, but now getting another:

root@maya-VirtualBox:/home/maya/ansible# ansible-playbook demo.yml -i hosts -vvvv  
ansible-playbook 2.9.7  
config file = /home/maya/ansible/ansible.cfg  
configured module search path = [‘/root/.ansible/plugins/modules’, ‘/usr/share/ansible/plugins/modules’]  
ansible python module location = /usr/local/lib/python3.6/dist-packages/ansible  
executable location = /usr/local/bin/ansible-playbook  
python version = 3.6.9 (default, Apr 18 2020, 01:56:04) [GCC 8.4.0]  
Using /home/maya/ansible/ansible.cfg as config file  
setting up inventory plugins  
host\_list declined parsing /home/maya/ansible/hosts as it did not pass its verify\_file() method  
script declined parsing /home/maya/ansible/hosts as it did not pass its verify\_file() method  
auto declined parsing /home/maya/ansible/hosts as it did not pass its verify\_file() method  
Set default localhost to localhost  
Parsed /home/maya/ansible/hosts inventory source with ini plugin  
Loading callback plugin default of type stdout, v2.0 from /usr/local/lib/python3.6/dist-packages/ansible/plugins/callback/default.py

PLAYBOOK: demo.yml \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*  
Positional arguments: demo.yml  
verbosity: 4  
connection: smart  
timeout: 10  
become\_method: sudo  
tags: (‘all’,)  
inventory: (‘/home/maya/ansible/hosts’,)  
forks: 5  
1 plays in demo.yml

PLAY [frr] \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*  
META: ran handlers

TASK [get facts of router] \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*  
task path: /home/maya/ansible/demo.yml:5  
The full traceback is:  
Traceback (most recent call last):  
File “/usr/local/lib/python3.6/dist-packages/ansible/executor/task\_executor.py”, line 146, in run  
res = self.\_execute()  
File “/usr/local/lib/python3.6/dist-packages/ansible/executor/task\_executor.py”, line 601, in \_execute  
self.\_connection = self.\_get\_connection(variables=variables, templar=templar)  
File “/usr/local/lib/python3.6/dist-packages/ansible/executor/task\_executor.py”, line 895, in \_get\_connection  
ansible\_playbook\_pid=to\_text(os.getppid())  
File “/usr/local/lib/python3.6/dist-packages/ansible/plugins/loader.py”, line 578, in get  
obj = obj(\*args, \*\*kwargs)  
File “/usr/local/lib/python3.6/dist-packages/ansible/plugins/connection/network\_cli.py”, line 331, in **init**  
self.cliconf = cliconf\_loader.get(self.\_network\_os, self)  
File “/usr/local/lib/python3.6/dist-packages/ansible/plugins/loader.py”, line 557, in get  
self.\_module\_cache[path] = self.\_load\_module\_source(name, path)  
File “/usr/local/lib/python3.6/dist-packages/ansible/plugins/loader.py”, line 530, in \_load\_module\_source  
spec.loader.exec\_module(module)  
File “”, line 678, in exec\_module  
File “”, line 219, in \_call\_with\_frames\_removed  
File “/usr/local/lib/python3.6/dist-packages/ansible/plugins/cliconf/frr.py”, line 41, in   
from ansible.module\_utils.basic import get\_timestamp  
ImportError: cannot import name ‘get\_timestamp’  
fatal: [cumulus01]: FAILED! =\> {  
“msg”: “Unexpected failure during module execution.”,  
“stdout”: “”  
}

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

root@maya-VirtualBox:/home/maya/ansible#

Thanks,  
Maya

---

<div class="post-metadata">

**Author:** ![mayape\_mayape](https://avatars.discourse-cdn.com/v4/letter/m/848f3c/32.png) [@mayape\_mayape](https://forum.ansible.com/u/mayape_mayape)\
**Post date:** [April 28, 2020, 4:07pm UTC](https://forum.ansible.com/t/frr-facts-and-or-frr-bgp-give-assertionerror/30653/14 "2020-04-28T16:07:21Z")

</div>

Seems like there is a bug. If commenting the line “from ansible.module\_utils.basic import get\_timestamp” in “ansible/plugins/cliconf/frr.py” it works.
