Ansible“;ios“l2”接口;模块不会将接口置于中继模式
我在剧本中使用了“ios_l2_接口”,我的ansible目前在2.9版上。 在playbook中,我已选择使用其他子命令(如allowed vlan和native vlan)将接口添加到中继模式,其他子命令将传递给设备,但命令“switchport mode trunk”不会传递给设备!你们有什么解决办法吗?我附上我的剧本供你参考Ansible“;ios“l2”接口;模块不会将接口置于中继模式,ansible,cisco,cisco-ios,Ansible,Cisco,Cisco Ios,我在剧本中使用了“ios_l2_接口”,我的ansible目前在2.9版上。 在playbook中,我已选择使用其他子命令(如allowed vlan和native vlan)将接口添加到中继模式,其他子命令将传递给设备,但命令“switchport mode trunk”不会传递给设备!你们有什么解决办法吗?我附上我的剧本供你参考 --- - name: Switches Interface Trunk hosts: Switch gather_facts: false task
---
- name: Switches Interface Trunk
hosts: Switch
gather_facts: false
tasks:
- name: configure trunk
ios_l2_interfaces:
config:
- name: GigabitEthernet2/0
trunk:
allowed_vlans: 99
native_vlan: 66
connection: network_cli
...
在输出上,我从正在运行的配置中获取此信息
!
interface GigabitEthernet2/0
switchport trunk allowed vlan 99
switchport trunk native vlan 66
media-type rj45
negotiation auto
!
这个问题更有可能得到答案