vyos_config question

Have been trying to get the vyos_config module to work (https://docs.ansible.com/ansible/vyos_config_module.html).

However always getting this error: fatal: [localhost]: FAILED! => {“changed”: false, “commands”: [“show configuration commands”], “failed”: true, “msg”: “timeout trying to send command: show configuration commands\r”}

Playbook looks like this

Just to update this. When it ssh’s in from the playbook it appears to only run this command.

1001 10471 10449 0 15:16 pts/1 00:00:00 -vbash

1001 10472 10449 1 15:16 pts/1 00:00:00 less --buffers=64 --auto-buffers --no-lessopen --QUIT-AT-EOF --quit-if-one-screen --RAW-CONTROL-CHARS --squeeze-blank-lines --no-init

1001 10473 10471 95 15:16 pts/1 00:00:00 cli-shell-api showConfig --show-active-only --show-commands

The cli-shell-api command does print the output when run manually.

`

  • name: Configure remote device.

vyos_config:

lines:

  • set service snmp community testing authorization ro

provider: “{{ cli }}”

`

This works exactly as intended when I try it running Ansible 2.2 from a CentOS control machine to a VyOS 1.1.17 node that was installed with the live cd downloaded from the VyOS website on to a Debian Jessie VM running in VirtualBox.

It’s not clear from your post, but are you running ansible on the VyOS machine itself? It seems like that’s the case since the connection is being set to local and the hosts lists is localhost. If that is the case, while I am far too ignorant to know exactly why it wouldn’t work, it feels like something that would be dodgy at best if not explicitly prohibited. Possibly because VyOS is based on mostly deprecated by this point packages on a distribution (Debian Squeeze) that is known for being rock solid stable but extremely slow to release software updates.

Is there a reason that you’d be running Ansible locally as opposed to from a control machine? If so, would you be so kind as to let us know what version of Ansible you’re running along with the full output of the current VyOS config (‘show configuration’)?

Thanks!

Thanks for the reply. I am running Ansible 2.2 from an Ubuntu machine. Maybe I am just not understanding the vyos_config correctly.

If I change the localhost (ubuntu machine) to the hostname of the vyos machine I get this error:

"msg": "paramiko is required but does not appear to be installed. It can be installed usingpip install paramiko

I assumed it had to be run with localhost so the vyos_config parameters would be the remote hostname/ip of the vyos machine.

Could you post your playbook that you used that worked for you?

Thank you.

You’re quite welcome. You have run into an error which I also had while setting up vms I used to test this for you.

The playbook in its entirety is pasted below:

`