# ansible-playbook don't see the custom connection plugin

**URL:** <https://forum.ansible.com/t/ansible-playbook-dont-see-the-custom-connection-plugin/34089>\
**Category:** Ansible Developer\
**Created:** [October 23, 2020, 11:49am UTC](https://forum.ansible.com/t/ansible-playbook-dont-see-the-custom-connection-plugin/34089 "2020-10-23T11:49:27Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Valentin\_Gusarin](https://avatars.discourse-cdn.com/v4/letter/v/7feea3/32.png) [@Valentin\_Gusarin](https://forum.ansible.com/u/Valentin_Gusarin)\
**Post date:** [October 23, 2020, 11:49am UTC](https://forum.ansible.com/t/ansible-playbook-dont-see-the-custom-connection-plugin/34089/1 "2020-10-23T11:49:27Z")

</div>

Hi!

I try to develope custom connection plugin. Plugin placed in ~/.ansible/plugins/connection folder and correctly seen by ansible-doc.  
But, when I try to run playbook, I have a message:  
{“msg”: “the connection plugin ‘packetlogic’ was not found”}

I tryed to research the reason. But found only that error happened hear:  
class Connection(ConnectionBase): def **init** (self, play\_context, new\_stdin, \*args, \*\*kwargs): super(Connection, self). **init** (play\_context, new\_stdin, \*args, \*\*kwargs)

When I made systax error in class Connection (fo test), I saw followin trace:

The full traceback is:

Traceback (most recent call last):

File “/usr/local/lib/python2.7/dist-packages/ansible/executor/task\_executor.py”, line 158, in run

res = self.\_execute()

File “/usr/local/lib/python2.7/dist-packages/ansible/executor/task\_executor.py”, line 613, in \_execute

self.\_connection = self.\_get\_connection(cvars, templar)

File “/usr/local/lib/python2.7/dist-packages/ansible/executor/task\_executor.py”, line 913, in \_get\_connection

ansible\_playbook\_pid=to\_text(os.getppid())

File “/usr/local/lib/python2.7/dist-packages/ansible/plugins/loader.py”, line 800, in get\_with\_context

self.\_module\_cache[path] = self.\_load\_module\_source(name, path)

File “/usr/local/lib/python2.7/dist-packages/ansible/plugins/loader.py”, line 769, in \_load\_module\_source

module = imp.load\_source(to\_native(full\_name), to\_native(path), module\_file)

File “/home/veg/.ansible/plugins/connection/packetlogic.py”, line 163

def \_connect(self):

^

IndentationError: expected an indented block

fatal: [pre01.mos1]: FAILED! =\> {

“msg”: “Unexpected failure during module execution.”,

“stdout”: “”

}

Can anyone helps me with this, pls?
