I have a question about automating network nodes using Ansible.
I want to get configuration of network node involving vlans (actually I just want to see the last vlan used in node, so that I could automatically create the next one).
When I log in to the Junos router, I write this command:
show configuration | display set | match interfaces | match ae0 | match description
and I get like 17 lines of configurations, all involving vlans (last line is the last vlan created)
I thought I would use junos_command
module for same command, register the output then show it in msg (first part of a bigger plan).
But it turns out that junos_command
only lets me use show configuration
which displays like 2500 lines of config.
Is there a way to make junos_command
give me the desired output, or should I just work with the output given, try to parse it in some ways? Any suggestions?
The only downside I see is that getting and parsing that output would take time as it would be quite large and being able to minimise the output would increase efficiency.
And maybe some suggestions about parsing the output as well? Any other means besides regex filters?