Using vyos module in ansible

I am trying to run “show nat destination rules” on a VYOS device.

I am using the vyos.vyos.vyos_command module for doing this task.

I want to store the output of this command to a variable because, storing it in a register is not working.

what is the end goal ?

When a new IP/host is created, the NAT entry for this host needs to be present on the vyos ddevice I will use the output of the variable(above) to extract only IP address and rule Number, and make a comparison to create new rules on the vyos device accordingly.

Regards, Venkat

I tried storing the value in a register the using the register module but seems register module is not supported with vyos module.

"invocation": {
    "module_args": {
        "commands": [
            "show nat destination rules"
        "interval": 1,
        "match": "all",
        "register": "natrules",
        "retries": 9,
        "wait_for": null
"msg": "Unsupported parameters for (vyos.vyos.vyos_command) module: register. Supported parameters include: interval, retries, commands, match, wait_for (waitfor)."


is there any other way to store the output of the vyos module to a variable ?

Show the playbook which you execute

Hello ,

it works now.
seems its indentation error.
below is the working code.

- name: show configuration on ethernet devices eth0 and eth1
    commands: show configuration all
  register: nat_output