Thanks to visit codestin.com
Credit goes to github.com

Skip to content

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

@juanda2

Description

@juanda2

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)]

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions