Created
February 22, 2019 12:52
-
-
Save trishnaguha/94265c345265ea1d6905580836cc614f to your computer and use it in GitHub Desktop.
match_all
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- 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