-
Notifications
You must be signed in to change notification settings - Fork 27
/
08_ios_l2_interfaces.yml
53 lines (48 loc) · 1.24 KB
/
08_ios_l2_interfaces.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
52
53
---
- name: IOS Config Demo
hosts: switches
tasks:
- name: Configure Access
ios_l2_interfaces:
config:
- name: GigabitEthernet0/2
access:
vlan: 10
state: merged
############# Trunk with Merged ##################
- name: Configure Trunk
ios_l2_interfaces:
config:
- name: GigabitEthernet0/2
trunk:
allowed_vlans: 11-15
encapsulation: dot1q
native_vlan: 5
state: merged
############ Trunk with Replaced ##################
- name: Configure Trunk
ios_l2_interfaces:
config:
- name: GigabitEthernet0/2
trunk:
allowed_vlans: 11-15
encapsulation: dot1q
native_vlan: 5
state: replaced
register: int
- debug:
var: int.before
- debug:
var: int.commands
- debug:
var: int.after
############ Trunk with Replaced ##################
- name: Configure Trunk
ios_l2_interfaces:
config:
- name: GigabitEthernet0/2
trunk:
allowed_vlans: 11-15
encapsulation: dot1q
native_vlan: 5
state: overridden