Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/rust/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ansible“;ios“l2”接口;模块不会将接口置于中继模式_Ansible_Cisco_Cisco Ios - Fatal编程技术网

Ansible“;ios“l2”接口;模块不会将接口置于中继模式

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

我在剧本中使用了“ios_l2_接口”,我的ansible目前在2.9版上。 在playbook中,我已选择使用其他子命令(如allowed vlan和native vlan)将接口添加到中继模式,其他子命令将传递给设备,但命令“switchport mode trunk”不会传递给设备!你们有什么解决办法吗?我附上我的剧本供你参考

---
- 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
!

这个问题更有可能得到答案