<127.0.0.1> using connection plugin network_cli (was local)

Hi!

I’ve started writing a new module for managing one Aruba Cloud provider
https://github.com/mz0/ansible/blob/329b9c199f/lib/ansible/modules/cloud/aruba_smart/aruba_smart_vm.py
and modeled my module on the digital_ocean_sshkey module.

However I cannot run my module - it fails very early on connection attempt which it quite unexpectedly does differently then the model module.
Here’re the relevant first lines of the good module run:

TASK [digital_ocean_sshkey] **************************************************************
task path: /lib/ansible/modules/cloud/digital_ocean/try1.yml:5
File lookup using /do/my.apikey as file
<127.0.0.1> ESTABLISH LOCAL CONNECTION FOR USER: mz0
<127.0.0.1> EXEC /bin/sh -c ‘echo ~mz0 && sleep 0’
<127.0.0.1> EXEC /bin/sh -c '( umask 77 && mkdir -p "` echo ~/.ansible/tmp/ansible-tmp-1…

Very early my module runs very differently (note the Subj. line):

TASK [aruba_smart_vm] ********************************************************************
task path: /lib/ansible/modules/cloud/aruba_smart/try1.yml:5
File lookup using /aruba/my.password as file
File lookup using /aruba/my.user as file
<127.0.0.1> using connection plugin network_cli (was local)
<127.0.0.1> starting connection from persistent connection plugin
<127.0.0.1> local domain socket does not exist, starting it
<127.0.0.1> control socket path is ~/.ansible/pc/…
<127.0.0.1>
The full traceback is:
Traceback (most recent call last):
File “/bin/ansible-connection”, line 103, in start
self.connection._connect()
File “/lib/ansible/plugins/connection/network_cli.py”, line 313, in _connect
ssh = self.paramiko_conn._connect()
File “/lib/ansible/plugins/connection/paramiko_ssh.py”, line 246, in _connect
self.ssh = SSH_CONNECTION_CACHE[cache_key] = self._connect_uncached()
File “/lib/ansible/plugins/connection/paramiko_ssh.py”, line 362, in _connect_uncached
raise AnsibleConnectionFailure(msg)
AnsibleConnectionFailure: paramiko: The authenticity of host ‘127.0.0.1’ can’t be established.

This playbook & module are here:
https://github.com/mz0/ansible/tree/329b9c199f/lib/ansible/modules/cloud/aruba_smart

The good playbook is very much the same:
https://github.com/mz0/ansible/blob/329b9c199f/lib/ansible/modules/cloud/digital_ocean/try1.yml

Please, suggest me the best course of action.

MZ

turns out Ansible (2.7.4, 2.8.0.dev0 in my case) auto-magically changes connection plugin seeing aruba* name.
Prefixing my module name (mv aruba_smart_vm.py it_aruba_smart_vm.py) helped.

MZ