vyos_command module says that paramiko is not installed.

903 views
Skip to first unread message

Lukas Nagy

unread,
Oct 24, 2016, 3:22:53 PM10/24/16
to Ansible Project
Hello.

I am trying to use VyOS module, included in Ansible 2.2. When I am trying to run simple playbook to set DHCP server, it fails on missing paramiko module. I've tried pip install paramiko but it is already installed. Reinstallation doesn't helped too. What should I do or what am I doing wrong? Thanks for help:

Version of Ansible:
ansible 2.2.0.0
  config file
= /etc/ansible/ansible.cfg
  configured
module search path = Default w/o overrides


Paramiko seems to be installed.
presales@PRESALES-ansible:~$ sudo -H pip2.7 install paramiko
Requirement already satisfied (use --upgrade to upgrade): paramiko in /usr/lib/python2.7/dist-packages
presales@PRESALES
-ansible:~$ sudo -H pip2 install paramiko
Requirement already satisfied (use --upgrade to upgrade): paramiko in /usr/lib/python2.7/dist-packages
presales@PRESALES
-ansible:~$ sudo -H pip install paramiko
Requirement already satisfied (use --upgrade to upgrade): paramiko in /usr/lib/python2.7/dist-packages
presales@PRESALES
-ansible:~$


I use Ubuntu 16.04.1 LTS

Here is the playbook I am trying to run:
 ---
 
- hosts: central_gw_dev
   
#strategy: debug
   remote_user
: ansible
   vars
:
       gw
:
           host
: 10.110.30.253
           username
: vyos
           password
: vyos
           transport
: cli
   tasks
:
       
- name: Test task
         vyos_command
:
             commands
:
                 
- set service dhcp-server shared-network-name Lab0-uplink
             provider
: "{{ gw }}"
 
...


And here is the error message:


PLAY
[central_gw_dev] **********************************************************


TASK
[setup] *******************************************************************
ok
: [10.110.30.253]


TASK
[Test task] ***************************************************************
fatal
: [10.110.30.253]: FAILED! => {"changed": false, "failed": true, "msg": "paramiko is required but does not appear to be installed.  It can be installed using  `pip install paramiko`"}
        to
retry, use: --limit @/home/presales/set-dhcp.retry


PLAY RECAP
*********************************************************************
10.110.30.253              : ok=1    changed=0    unreachable=0    failed=1


Thanks for help.


Barney Sowood

unread,
Oct 24, 2016, 3:43:10 PM10/24/16
to ansible...@googlegroups.com
Hi,


On Mon, 24 Oct 2016, at 03:31 PM, Lukas Nagy wrote:
I am trying to use VyOS module, included in Ansible 2.2. When I am trying to run simple playbook to set DHCP server, it fails on missing paramiko module. I've tried pip install paramiko but it is already installed. Reinstallation doesn't helped too. What should I do or what am I doing wrong?

Try adding "connection: local", otherwise it will try and push the module and run it on the remote device via ssh.

I'm not sure why the default behaviour for network modules isn't to assume running locally, I guess you may want to delegate to another machine, but the default behaviour seems non-obvious and if it's documented I couldn't see where.

Regards,

Barney


--
  Barney Sowood


Lukas Nagy

unread,
Oct 25, 2016, 2:43:53 AM10/25/16
to Ansible Project
Thank you very much, this fixed the issue. Now it sucessfully executes commands. You are right, I haven't seen this in documentation at all, could this be added to it, for others to resolve the issue?

Dňa pondelok, 24. októbra 2016 21:43:10 UTC+2 Barney Sowood napísal(-a):

Chris Rigby

unread,
Feb 6, 2017, 9:41:41 AM2/6/17
to Ansible Project
Where do you add `connection: local`? 

I added it a the top of my playbook underneath `hosts: all` and it still complains about paramiko not being installed on the vyos host. 
Reply all
Reply to author
Forward
0 new messages