Skip to content

Instantly share code, notes, and snippets.

@cidrblock
Created July 22, 2016 22:10
Show Gist options
  • Save cidrblock/95a84b445380805f444124bba20f01ca to your computer and use it in GitHub Desktop.
Save cidrblock/95a84b445380805f444124bba20f01ca to your computer and use it in GitHub Desktop.
---
- name: test seassclrt001
ios_config:
host: "{{ inventory_hostname }}"
before: ['no ip access-list standard test']
parents: ['ip access-list standard test']
lines:
- permit 1.1.1.1
- permit 1.1.1.2
- permit 1.1.1.3
- permit 1.1.1.4
replace: block
- name: show ACL
ios_command:
host: "{{ inventory_hostname }}"
commands:
- sho ip access-list test
register: output
- debug: msg="{{ output.stdout_lines[0] }}"
- name: test seassclrt001
ios_config:
host: "{{ inventory_hostname }}"
before: ['no ip access-list standard test']
parents: ['ip access-list standard test']
lines:
- permit 1.1.1.1
replace: block
match: strict
- name: show ACL
ios_command:
host: "{{ inventory_hostname }}"
commands:
- sho ip access-list test
register: output
- debug: msg="{{ output.stdout_lines[0] }}"
< TASK [snmp-acl : test seassclrt001] >
-------------------------------------
\ ^__^
\ (oo)\_______
(__)\ )\/\
||----w |
|| ||
ok: [seassclrt001.starbucks.net]
____________________________
< TASK [snmp-acl : show ACL] >
----------------------------
\ ^__^
\ (oo)\_______
(__)\ )\/\
||----w |
|| ||
ok: [seassclrt001.starbucks.net]
_________________________
< TASK [snmp-acl : debug] >
-------------------------
\ ^__^
\ (oo)\_______
(__)\ )\/\
||----w |
|| ||
ok: [seassclrt001.starbucks.net] => {
"msg": [
"Standard IP access list test",
" 10 permit 1.1.1.1",
" 30 permit 1.1.1.3",
" 20 permit 1.1.1.2",
" 40 permit 1.1.1.4"
]
}
_____________________________________
< TASK [snmp-acl : test seassclrt001] >
-------------------------------------
\ ^__^
\ (oo)\_______
(__)\ )\/\
||----w |
|| ||
ok: [seassclrt001.starbucks.net]
____________________________
< TASK [snmp-acl : show ACL] >
----------------------------
\ ^__^
\ (oo)\_______
(__)\ )\/\
||----w |
|| ||
ok: [seassclrt001.starbucks.net]
_________________________
< TASK [snmp-acl : debug] >
-------------------------
\ ^__^
\ (oo)\_______
(__)\ )\/\
||----w |
|| ||
ok: [seassclrt001.starbucks.net] => {
"msg": [
"Standard IP access list test",
" 10 permit 1.1.1.1",
" 30 permit 1.1.1.3",
" 20 permit 1.1.1.2",
" 40 permit 1.1.1.4"
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment