Related Posts

Ansible Playbook to execute CLI commands

Hi communitydo you have an example of an..
Read More

https://github.com/versa-networks/devops

The GitHub repository named devops is m..
Read More

Inventory Collection using Python

Here is an example script from Versa Git..
Read More

Ansible Playbook to execute CLI commands

Hi community,

do you have an example of an ansible playbook which executes commands on a VOS device (CLI commands)?


thanks!

Maksym

Comments

  • Hi,

    You can pipe your cli command to /opt/versa/confd/bin/confd_cli on the VOS device.

    If you want to process the output, I suggest to use the display json, so you will have the output in json format.


    Here is an example ansible task how to use it:


       - name: "Get NTP status"

         ansible.builtin.shell:

           cmd: echo "show ntp statistics | display json" | /opt/versa/confd/bin/confd_cli

         register: output

    Maksym
Sign In or Register to comment.
/* */