dne-dna-code icon indicating copy to clipboard operation
dne-dna-code copied to clipboard

ansible module might return an error: "invalid connection specified, expected connection=local, got network_cli"

Open juanda2 opened this issue 4 years ago • 0 comments

If ansible module returns an error: "invalid connection specified, expected connection=local, got network_cli" it is due to the venv not getting created properly (unknown why)

The solution is to delete or deactivate the virtual environment, and try again. Then, after installing the requirements the ansible version should get updated properly and change from:

(venv) [developer@centos intro-ansible]$ ansible --version ansible 2.4.3.0 (...) python version = 2.7.5 (default, Aug 4 2017, 00:39:18) [GCC 4.8.5 20150623 (Red Hat 4.8.5-16)]

to this:

(venv2) [developer@centos intro-ansible]$ ansible --version ansible 2.5.4 (...) python version = 3.6.5 (default, Mar 31 2018, 15:47:21) [GCC 4.8.5 20150623 (Red Hat 4.8.5-16)]

juanda2 avatar Feb 26 '20 21:02 juanda2