fortinet.fortimanager.fmgr_switchcontroller_managedswitch_ports 模块 – 管理交换机端口列表。

注意

此模块是 fortinet.fortimanager 集合(版本 2.8.2)的一部分。

如果您正在使用 ansible 包,您可能已经安装了此集合。它不包含在 ansible-core 中。要检查是否已安装,请运行 ansible-galaxy collection list

要安装它,请使用:ansible-galaxy collection install fortinet.fortimanager

要在剧本中使用它,请指定:fortinet.fortimanager.fmgr_switchcontroller_managedswitch_ports

fortinet.fortimanager 2.0.0 中的新增功能

概要

  • 此模块能够配置 FortiManager 设备。

  • 示例包括所有参数和值,这些参数和值需要在使用前调整为数据源。

参数

参数

注释

access_token

字符串

用于在不使用用户名和密码的情况下访问 FortiManager 的令牌。

adom

字符串 / 必需

请求的 URL 中的参数 (adom)。

bypass_validation

布尔值

仅当模块架构与 FortiManager API 结构不同时才设置为 True,模块将继续执行而不验证参数。

选择

  • false ←(默认)

  • true

enable_log

布尔值

启用/禁用任务日志记录。

选择

  • false ←(默认)

  • true

forticloud_access_token

字符串

使用 forticloud API 访问令牌对 Ansible 客户端进行身份验证。

managed-switch

字符串

已弃用,请使用“managed_switch”

managed_switch

字符串

请求的 URL 中的参数 (managed-switch)。

proposed_method

字符串

底层 Json RPC 请求的覆盖方法。

选择

  • “update”

  • “set”

  • “add”

rc_failed

列表 / elements=integer

将覆盖失败条件的 rc 代码列表。

rc_succeeded

列表 / elements=integer

将覆盖成功条件的 rc 代码列表。

state

字符串 / 必需

用于创建、更新或删除对象的指令。

选择

  • “present”

  • “absent”

switchcontroller_managedswitch_ports

字典

设置的顶级参数。

access_mode

别名:access-mode

字符串

端口的访问模式。

选择

  • “normal”

  • “nac”

  • “dynamic”

  • “static”

acl_group

别名:acl-group

any

(列表)此端口上的 ACL 组。

aggregator_mode

别名:aggregator-mode

字符串

LACP 成员选择模式。

选择

  • “bandwidth”

  • “count”

allow_arp_monitor

别名:allow-arp-monitor

字符串

启用/禁用允许 ARP 监视器。

选择

  • “disable”

  • “enable”

allowed_vlans

别名:allowed-vlans

any

(列表或字符串)配置交换机端口标记的 VLAN

allowed_vlans_all

别名:allowed-vlans-all

字符串

启用/禁用此端口上所有已定义的 VLAN。

选择

  • “disable”

  • “enable”

arp_inspection_trust

别名:arp-inspection-trust

字符串

受信任或不受信任的动态 ARP 检查。

选择

  • “untrusted”

  • “trusted”

authenticated_port

别名:authenticated-port

整数

已验证的端口。

bundle

字符串

启用/禁用链路聚合组

选择

  • “disable”

  • “enable”

description

字符串

端口的描述。

dhcp_snoop_option82_override

别名:dhcp-snoop-option82-override

列表 / elements=dictionary

DHCP 监听选项 82 覆盖。

circuit_id

别名:circuit-id

字符串

电路 ID 字符串。

remote_id

别名:remote-id

字符串

远程 ID 字符串。

vlan_name

别名:vlan-name

字符串

DHCP 监听选项 82 VLAN。

dhcp_snoop_option82_trust

别名:dhcp-snoop-option82-trust

字符串

启用/禁用在不信任接口上允许使用 option-82 的 DHCP。

选择

  • “disable”

  • “enable”

dhcp_snooping

别名: dhcp-snooping

字符串

受信任或不受信任的 DHCP 侦听接口。

选择

  • “trusted”

  • “untrusted”

discard_mode

别名: discard-mode

字符串

配置端口的丢弃模式。

选择

  • "none"

  • "all-untagged"

  • "all-tagged"

dot1x_enable

别名: dot1x-enable

字符串

启用 Dot1x。

选择

  • “disable”

  • “enable”

dsl_profile

别名: dsl-profile

字符串

DSL 策略配置。

edge_port

别名: edge-port

字符串

启用/禁用此接口作为边缘端口,用于桥接工作站和/或计算机之间的连接。

选择

  • “disable”

  • “enable”

encrypted_port

别名: encrypted-port

整数

加密端口。

export_tags

别名: export-tags

any

(列表)配置导出标签

export_to

别名: export-to

any

(列表)将托管交换机端口导出到租户 VDOM。

export_to_pool

别名: export-to-pool

any

(列表)将交换机控制器端口导出到池列表。

export_to_pool_flag

别名: export-to-pool-flag

整数

将交换机控制器端口导出到池列表。

fallback_port

别名: fallback-port

字符串

LACP 回退端口。

fec_capable

别名: fec-capable

整数

支持 FEC。

fec_state

别名: fec-state

字符串

前向纠错的状态。

选择

  • "disabled"

  • "cl74"

  • "cl91"

  • "detect-by-module"

fgt_peer_device_name

别名: fgt-peer-device-name

字符串

Fgt 对等设备名称。

fgt_peer_port_name

别名: fgt-peer-port-name

字符串

Fgt 对等端口名称。

fiber_port

别名: fiber-port

整数

光纤端口。

flags

整数

标志。

flap_duration

别名: flap-duration

整数

计算抖动事件的时间段

flap_rate

别名: flap-rate

整数

在抖动持续时间内需要发生的阶段更改事件数。

flap_timeout

别名: flap-timeout

整数

抖动保护禁用保护

flapguard

字符串

启用/禁用抖动保护。

选择

  • “disable”

  • “enable”

flow_control

别名: flow-control

字符串

流控制方向。

选择

  • “disable”

  • "tx"

  • "rx"

  • "both"

fortilink_port

别名: fortilink-port

整数

Fortilink 端口。

fortiswitch_acls

别名: fortiswitch-acls

any

(列表)此端口上的 ACL。

igmp_snooping

别名: igmp-snooping

字符串

为物理端口接口设置 IGMP 侦听模式。

选择

  • “disable”

  • “enable”

igmp_snooping_flood_reports

别名: igmp-snooping-flood-reports

字符串

启用/禁用在启用 igmp-snooping 时将 IGMP 报告泛洪到此接口。

选择

  • “disable”

  • “enable”

igmps_flood_reports

别名: igmps-flood-reports

字符串

启用/禁用在启用 igmp-snooping 时将 IGMP 报告泛洪到此接口。

选择

  • “disable”

  • “enable”

igmps_flood_traffic

别名: igmps-flood-traffic

字符串

启用/禁用将 IGMP 侦听流量泛洪到此接口。

选择

  • “disable”

  • “enable”

interface_tags

别名: interface-tags

any

(列表或字符串)标签

ip_source_guard

别名: ip-source-guard

字符串

启用/禁用 IP 源保护。

选择

  • “disable”

  • “enable”

isl_local_trunk_name

别名: isl-local-trunk-name

字符串

Isl 本地中继名称。

isl_peer_device_name

别名: isl-peer-device-name

字符串

Isl 对等设备名称。

isl_peer_device_sn

别名: isl-peer-device-sn

字符串

Isl 对等设备序列号。

isl_peer_port_name

别名: isl-peer-port-name

字符串

Isl 对等端口名称。

lacp_speed

别名: lacp-speed

字符串

链路聚合控制协议结束

选择

  • "slow"

  • "fast"

learning_limit

别名: learning-limit

整数

限制此端口上的动态 MAC 地址数量

link_status

别名: link-status

字符串

链路状态。

选择

  • "down"

  • "up"

lldp_profile

别名: lldp-profile

字符串

LLDP 端口 TLV 配置文件。

lldp_status

别名: lldp-status

字符串

LLDP 发送和接收状态。

选择

  • “disable”

  • "rx-only"

  • "tx-only"

  • "tx-rx"

log_mac_event

别名: log-mac-event

字符串

启用/禁用动态 MAC 地址事件的日志记录。

选择

  • “disable”

  • “enable”

loop_guard

别名: loop-guard

字符串

在此接口上启用/禁用环路保护,一种用于防止网络环路的 STP 优化。

选择

  • "disabled"

  • "enabled"

loop_guard_timeout

别名: loop-guard-timeout

整数

环路保护超时

mac_addr

别名: mac-addr

字符串

端口/中继 MAC。

matched_dpp_intf_tags

别名: matched-dpp-intf-tags

字符串

动态端口策略中匹配的接口标签。

matched_dpp_policy

别名: matched-dpp-policy

字符串

动态端口策略中匹配的子策略。

max_bundle

别名: max-bundle

整数

LAG 捆绑的最大大小

max_miss_heartbeats

别名: max-miss-heartbeats

整数

最大容忍的丢失心跳数。

mcast_snooping_flood_traffic

别名: mcast-snooping-flood-traffic

字符串

启用/禁用将 IGMP 侦听流量泛洪到此接口。

选择

  • “disable”

  • “enable”

mclag

字符串

启用/禁用多机箱链路聚合

选择

  • “disable”

  • “enable”

mclag_icl_port

别名: mclag-icl-port

整数

Mclag icl 端口。

media_type

别名: media-type

字符串

介质类型。

member_withdrawal_behavior

别名: member-withdrawal-behavior

字符串

端口在因控制数据包丢失而退出后的行为。

选择

  • "forward"

  • "block"

members

any

(列表)聚合 LAG 捆绑接口。

min_bundle

别名: min-bundle

整数

LAG 捆绑的最小大小

mode

字符串

LACP 模式

选择

  • “static”

  • "lacp-passive"

  • "lacp-active"

p2p_port

别名: p2p-port

整数

P2p 端口。

packet_sample_rate

别名: packet-sample-rate

整数

数据包采样率

packet_sampler

别名: packet-sampler

字符串

启用/禁用此接口上的数据包采样。

选择

  • "disabled"

  • "enabled"

pause_meter

别名: pause-meter

整数

配置入口暂停计量速率,单位为 kbps

pause_meter_resume

别名: pause-meter-resume

字符串

恢复入口端口流量的恢复阈值。

选择

  • "25%"

  • "50%"

  • "75%"

pd_capable

别名: pd-capable

整数

供电设备支持。

poe_capable

别名: poe-capable

整数

支持 PoE。

poe_max_power

别名: poe-max-power

字符串

PoE 最大功率。

poe_mode_bt_cabable

别名: poe-mode-bt-cabable

整数

PoE 模式 IEEE 802。

poe_port_mode

别名: poe-port-mode

字符串

配置 PoE 端口模式。

选择

  • "ieee802-3af"

  • "ieee802-3at"

  • "ieee802-3bt"

poe_port_power

别名: poe-port-power

字符串

配置 PoE 端口功率。

选择

  • “normal”

  • "perpetual"

  • "perpetual-fast"

poe_port_priority

别名: poe-port-priority

字符串

配置 PoE 端口优先级。

选择

  • "关键优先级"

  • "高优先级"

  • "低优先级"

  • "中优先级"

poe_pre_standard_detection

别名: poe-pre-standard-detection

字符串

启用/禁用 PoE 预标准检测。

选择

  • “disable”

  • “enable”

poe_standard

别名: poe-standard

字符串

PoE 标准。

poe_status

别名: poe-status

字符串

启用/禁用 PoE 状态。

选择

  • “disable”

  • “enable”

port_name

别名: port-name

字符串 / 必需

交换机端口名称。

port_number

别名: port-number

整数

端口号。

port_owner

别名: port-owner

字符串

交换机端口名称。

port_policy

别名: port-policy

字符串

从可用选项中选择交换机控制器动态端口策略。

port_prefix_type

别名: port-prefix-type

整数

端口前缀类型。

port_security_policy

别名: port-security-policy

字符串

从可用选项中选择应用于此托管交换机的交换机控制器身份验证策略。

port_selection_criteria

别名: port-selection-criteria

字符串

聚合端口选择的算法。

选择

  • "src-mac"

  • "dst-mac"

  • "src-dst-mac"

  • "src-ip"

  • "dst-ip"

  • "src-dst-ip"

ptp_policy

别名: ptp-policy

any

(列表) PTP 策略配置。

ptp_status

别名: ptp-status

字符串

在此 FortiSwitch 端口上启用/禁用 PTP 策略。

选择

  • “disable”

  • “enable”

qnq

any

(列表) ‘802.’

qos_policy

别名: qos-policy

字符串

从可用选项中选择交换机控制器 QoS 策略。

restricted_auth_port

别名: restricted-auth-port

整数

受限身份验证端口。

rpvst_port

别名: rpvst-port

字符串

在此接口上启用/禁用与快速 PVST 的互操作性。

选择

  • "disabled"

  • "enabled"

sample_direction

别名: sample-direction

字符串

SFlow 采样方向。

选择

  • "rx"

  • "tx"

  • "both"

sflow_counter_interval

别名: sflow-counter-interval

整数

SFlow 采样器计数器轮询间隔

sflow_sample_rate

别名: sflow-sample-rate

整数

SFlow 采样器采样率

sflow_sampler

别名: sflow-sampler

字符串

在此接口上启用/禁用 sFlow 协议。

选择

  • "disabled"

  • "enabled"

速度

字符串

交换机端口速度;默认和可用设置取决于硬件。

选择

  • "自动"

  • "10全双工"

  • "10半双工"

  • "100全双工"

  • "100半双工"

  • "1000全双工"

  • "10000全双工"

  • "1000自动"

  • "40000全双工"

  • "1000光纤"

  • "10000"

  • "40000"

  • "自动模块"

  • "100FX-半双工"

  • "100FX-全双工"

  • "100000全双工"

  • "2500全双工"

  • "25000全双工"

  • "50000全双工"

  • "40000自动"

  • "10000cr"

  • "10000sr"

  • "100000sr4"

  • "100000cr4"

  • "25000cr4"

  • "25000sr4"

  • "5000全双工"

  • "2500自动"

  • "5000自动"

  • "1000全双工-光纤"

  • "40000sr4"

  • "40000cr4"

  • "25000cr"

  • "25000sr"

  • "50000cr"

  • "50000sr"

speed_mask

别名: speed-mask

整数

交换机端口速度掩码。

stacking_port

别名: stacking-port

整数

堆叠端口。

状态

字符串

交换机端口管理状态

选择

  • "down"

  • "up"

sticky_mac

别名: sticky-mac

字符串

在接口上启用或禁用粘性 MAC 地址。

选择

  • “disable”

  • “enable”

storm_control_policy

别名: storm-control-policy

字符串

从可用选项中选择交换机控制器风暴控制策略。

stp_bpdu_guard

别名: stp-bpdu-guard

字符串

在此接口上启用/禁用 STP BPDU 保护。

选择

  • "disabled"

  • "enabled"

stp_bpdu_guard_timeout

别名: stp-bpdu-guard-timeout

整数

BPDU 保护禁用保护

stp_root_guard

别名: stp-root-guard

字符串

在此接口上启用/禁用 STP 根保护。

选择

  • "disabled"

  • "enabled"

stp_state

别名: stp-state

字符串

启用/禁用生成树协议

选择

  • "disabled"

  • "enabled"

switch_id

别名: switch-id

字符串

交换机 ID。

trunk_member

别名: trunk-member

整数

Trunk 成员。

类型

字符串

接口类型

选择

  • "物理"

  • "Trunk"

untagged_vlans

别名: untagged-vlans

any

(列表或字符串) 配置交换机端口未标记的 VLAN

virtual_port

别名: virtual-port

整数

虚拟化交换机端口。

vlan

字符串

将交换机端口分配给 VLAN。

workspace_locking_adom

字符串

在工作区模式下运行的 FortiManager 要锁定的 ADOM,该值可以是全局的,也可以是包括 root 的其他值。

workspace_locking_timeout

整数

等待其他用户释放工作区锁定的最大时间(以秒为单位)。

默认值: 300

注释

注意

  • 从 2.4.0 版本开始,所有输入参数均使用下划线命名约定 (snake_case)。请将 “var-name” 之类的参数更改为 “var_name”。旧的参数名称仍然可用,但您会收到弃用警告。您可以在 ansible.cfg 中设置 deprecation_warnings=False 来忽略此警告。

  • 此 FortiManager 模块支持在工作区锁定模式下运行,顶层参数 workspace_locking_adom 和 workspace_locking_timeout 有助于完成此工作。

  • 要创建或更新对象,请使用 state present 指令。

  • 要删除对象,请使用 state absent 指令。

  • 通常,当返回非零 rc 时,运行一个模块可能会失败。您也可以使用参数 rc_failed 和 rc_succeeded 来覆盖失败或成功的条件

示例

- name: Example playbook (generated based on argument schema)
  hosts: fortimanagers
  connection: httpapi
  vars:
    ansible_httpapi_use_ssl: true
    ansible_httpapi_validate_certs: false
    ansible_httpapi_port: 443
  tasks:
    - name: Managed-switch port list.
      fortinet.fortimanager.fmgr_switchcontroller_managedswitch_ports:
        # bypass_validation: false
        workspace_locking_adom: <value in [global, custom adom including root]>
        workspace_locking_timeout: 300
        # rc_succeeded: [0, -2, -3, ...]
        # rc_failed: [-2, -3, ...]
        adom: <your own value>
        managed_switch: <your own value>
        state: present # <value in [present, absent]>
        switchcontroller_managedswitch_ports:
          allowed_vlans: <list or string>
          allowed_vlans_all: <value in [disable, enable]>
          arp_inspection_trust: <value in [untrusted, trusted]>
          bundle: <value in [disable, enable]>
          description: <string>
          dhcp_snoop_option82_trust: <value in [disable, enable]>
          dhcp_snooping: <value in [trusted, untrusted]>
          discard_mode: <value in [none, all-untagged, all-tagged]>
          edge_port: <value in [disable, enable]>
          igmp_snooping: <value in [disable, enable]>
          igmps_flood_reports: <value in [disable, enable]>
          igmps_flood_traffic: <value in [disable, enable]>
          lacp_speed: <value in [slow, fast]>
          learning_limit: <integer>
          lldp_profile: <string>
          lldp_status: <value in [disable, rx-only, tx-only, ...]>
          loop_guard: <value in [disabled, enabled]>
          loop_guard_timeout: <integer>
          max_bundle: <integer>
          mclag: <value in [disable, enable]>
          member_withdrawal_behavior: <value in [forward, block]>
          members: <list or string>
          min_bundle: <integer>
          mode: <value in [static, lacp-passive, lacp-active]>
          poe_pre_standard_detection: <value in [disable, enable]>
          poe_status: <value in [disable, enable]>
          port_name: <string>
          port_owner: <string>
          port_security_policy: <string>
          port_selection_criteria: <value in [src-mac, dst-mac, src-dst-mac, ...]>
          qos_policy: <string>
          sample_direction: <value in [rx, tx, both]>
          sflow_counter_interval: <integer>
          sflow_sample_rate: <integer>
          sflow_sampler: <value in [disabled, enabled]>
          stp_bpdu_guard: <value in [disabled, enabled]>
          stp_bpdu_guard_timeout: <integer>
          stp_root_guard: <value in [disabled, enabled]>
          stp_state: <value in [disabled, enabled]>
          type: <value in [physical, trunk]>
          untagged_vlans: <list or string>
          vlan: <string>
          export_to_pool_flag: <integer>
          mac_addr: <string>
          packet_sample_rate: <integer>
          packet_sampler: <value in [disabled, enabled]>
          sticky_mac: <value in [disable, enable]>
          storm_control_policy: <string>
          dot1x_enable: <value in [disable, enable]>
          max_miss_heartbeats: <integer>
          access_mode: <value in [normal, nac, dynamic, ...]>
          ip_source_guard: <value in [disable, enable]>
          mclag_icl_port: <integer>
          p2p_port: <integer>
          aggregator_mode: <value in [bandwidth, count]>
          rpvst_port: <value in [disabled, enabled]>
          flow_control: <value in [disable, tx, rx, ...]>
          media_type: <string>
          pause_meter: <integer>
          pause_meter_resume: <value in [25%, 50%, 75%]>
          trunk_member: <integer>
          fec_capable: <integer>
          fec_state: <value in [disabled, cl74, cl91, ...]>
          matched_dpp_intf_tags: <string>
          matched_dpp_policy: <string>
          port_policy: <string>
          status: <value in [down, up]>
          dsl_profile: <string>
          flap_duration: <integer>
          flap_rate: <integer>
          flap_timeout: <integer>
          flapguard: <value in [disable, enable]>
          interface_tags: <list or string>
          poe_max_power: <string>
          poe_standard: <string>
          igmp_snooping_flood_reports: <value in [disable, enable]>
          mcast_snooping_flood_traffic: <value in [disable, enable]>
          link_status: <value in [down, up]>
          poe_mode_bt_cabable: <integer>
          poe_port_mode: <value in [ieee802-3af, ieee802-3at, ieee802-3bt]>
          poe_port_power: <value in [normal, perpetual, perpetual-fast]>
          poe_port_priority: <value in [critical-priority, high-priority, low-priority, ...]>
          acl_group: <list or string>
          dhcp_snoop_option82_override:
            -
              circuit_id: <string>
              remote_id: <string>
              vlan_name: <string>
          fortiswitch_acls: <list or integer>
          isl_peer_device_sn: <string>
          authenticated_port: <integer>
          encrypted_port: <integer>
          ptp_status: <value in [disable, enable]>
          restricted_auth_port: <integer>
          allow_arp_monitor: <value in [disable, enable]>
          export_to: <list or string>
          export_to_pool: <list or string>
          fallback_port: <string>
          fgt_peer_device_name: <string>
          fgt_peer_port_name: <string>
          fiber_port: <integer>
          flags: <integer>
          fortilink_port: <integer>
          isl_local_trunk_name: <string>
          isl_peer_device_name: <string>
          isl_peer_port_name: <string>
          poe_capable: <integer>
          port_number: <integer>
          port_prefix_type: <integer>
          ptp_policy: <list or string>
          speed: <value in [auto, 10full, 10half, ...]>
          speed_mask: <integer>
          stacking_port: <integer>
          switch_id: <string>
          virtual_port: <integer>
          export_tags: <list or string>
          log_mac_event: <value in [disable, enable]>
          pd_capable: <integer>
          qnq: <list or string>

返回值

通用返回值在此处有文档记录:这里,以下是此模块独有的字段

描述

meta

字典

请求的结果。

已返回: 总是

request_url

字符串

请求的完整 URL。

已返回: 总是

示例: "/sys/login/user"

response_code

整数

API 请求的状态。

已返回: 总是

示例: 0

response_data

列表 / 元素=字符串

API 响应。

已返回: 总是

response_message

字符串

API 响应的描述性消息。

已返回: 总是

示例: "OK."

system_information

字典

目标系统的信息。

已返回: 总是

rc

整数

请求的状态。

已返回: 总是

示例: 0

version_check_warning

列表 / 元素=字符串

如果 playbook 中使用的参数不受当前 FortiManager 版本支持,则发出警告。

已返回: 复杂

作者

  • Xinwei Du (@dux-fortinet)

  • Xing Li (@lix-fortinet)

  • Jie Xue (@JieX19)

  • Link Zheng (@chillancezen)

  • Frank Shen (@fshen01)

  • Hongbin Lu (@fgtdev-hblu)