Skip to content

Instantly share code, notes, and snippets.

@trishnaguha
Created February 22, 2019 12:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save trishnaguha/94265c345265ea1d6905580836cc614f to your computer and use it in GitHub Desktop.
Save trishnaguha/94265c345265ea1d6905580836cc614f to your computer and use it in GitHub Desktop.
match_all
- name: trunk allowed vlan
pattern_match:
regex: " switchport trunk allowed vlan (.*)"
content: "{{ item }}"
match_all: yes
register: allowed_vlans
Return would be somewhat like
```
"allowed_vlans": [
{
"matches": "15-19,25-29,35-39,45-49,55-59,65-69"
},
{
"matches": "add 85-89,95-99,636,698,752,901,997"
},
{
"matches": "add 1104,1119,1999,3800-3810"
}
],
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment