I'm looking to limit the returned data from a Juniper
switch in Ansible and I don't see to be able to get the match
command passed across to the device.
On the device I can run;
show vlans | match "(\d+)"
This returns a list of all active vlans on the device, however ignores the interfaces set to each one. I want to return this same result using Ansible
, however when I passed it the following code, it returns the entire data set for show vlans
.
- name: Gathering active vlans..
junipernetworks.junos.junos_command:
commands:
- "show vlans | match '(\\d+)'"
register: vlan_list
tags:
- core
- access
- name: test
debug:
msg: "{{vlan_list}}"
tags:
- always
How can I update my playbook to ensure the match regex is sent to the device?