- In the group_vars/network.yml file, add the following content to define the generic interface parameters:
$ cat group_vars/network.yml
<-- Output Trimmed for brevity ------>
intf_duplex: full
intf_mtu: 1500
- Create a new file, lan.yml, under the group_vars folder, with the following data to define the interfaces on our Cisco devices:
$ cat group_vars/lan.yaml
interfaces:
core01:
- name: Ethernet0/1
description: access01_e0/1
mode: trunk
- name: Ethernet0/2
description: access02_e0/1
mode: trunk
- name: Ethernet0/3
description: core01_e0/3
mode: trunk
<-- Output Trimmed for brevity ------>
access01:
- name: Ethernet0/1
description: core01_e0/1
mode: trunk
- name: Ethernet0/2
description: core02_e0/1
mode: trunk
- name: Ethernet0/3
description: Data_vlan
mode: access
vlan: 10
- Update the pb_build_network.yml playbook file with the following task to set up the interfaces:
- name: "P1T3: Configure Interfaces"
ios_interface:
name: "{{ item.name }}"
description: "{{ item.description }}"
duplex: "{{ intf_duplex }}"
mtu: "{{ intf_mtu }}"
state: up
loop: "{{ interfaces[inventory_hostname] }}"
register: ios_intf