48. 48
$ ansible-playbook -i inventory l2port_for_nxos.yml -vvv
PLAYBOOK: l2port_for_nxos.yml ************************************
1 plays in l2port_for_nxos.yml
PLAY [core-sw_nxos] **********************************************
TASK [Gathering Facts] *******************************************
ok: [core-sw]
TASK [mode to tagged port] ***************************************
fatal: [core-sw]: FAILED! => {
"changed": false,
"msg": "Ensure interface is configured to be a L2nport first before using this module. You can usenthe nxos_interface module for this."
}
PLAY RECAP *******************************************************
core-sw : ok=1 changed=0 unreachable=0 failed=1
49. 49
- hosts: core-sw_nxos
tasks:
- name: mode to layer2
nxos_interface:
name: Ethernet3/2
mode: layer2
- name: mode to tagged port
nxos_l2_interface:
name: Ethernet3/2
mode: trunk
trunk_allowed_vlans: 130
core-sw# show running-config
:
interface Ethernet3/2
shutdown
no switchport
mac-address 0000.0000.002f
: