-
Notifications
You must be signed in to change notification settings - Fork 0
/
del-macsec-all-commands.yml
51 lines (43 loc) · 1.31 KB
/
del-macsec-all-commands.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
---
- name: IOS-XE - WAN MACsec EAPoL Modification Playbook
hosts: routers
connection: local
gather_facts: no
# I decided to enter MACsec specific commands and variables directly into the Playbook. There are other options of course
vars:
int_name: TenGigabitEthernet0/0/0
e_type_num: 876F
eapol_address: broadcast-address
tasks:
- name: Get Login credentials
include_vars: ~/access.yml
- name: Define Provider
set_fact:
provider:
# This references my "access.yml' file for login credentials
host: "{{ inventory_hostname }}"
username: "{{ access['username'] }}"
password: "{{ access['password'] }}"
- name: DELETE MACsec and EAPoL Commands from Interface
ios_config:
provider: "{{ provider }}"
authorize: yes
lines:
# Completely delete macsec from the interface
- no macsec
parents: ['interface {{ int_name }}']
match: exact
#- name: Clear MKA Sessions
# ios_command:
# provider: "{{ provider }}"
# commands:
# - command: 'clear mka sessions'
# prompt: 'Are you sure you want to do this? [yes/no]:'
# answer: y
# connection: network_cli
handlers:
- name: write config
ios_config:
provider: "{{ provider }}"
save_when: modified
...