fortinet.fortimanager.fmgr_switchcontroller_lldpprofile 模块 – 配置 FortiSwitch LLDP 配置文件。

注意

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

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

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

要在 playbook 中使用它,请指定: fortinet.fortimanager.fmgr_switchcontroller_lldpprofile

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 客户端。

proposed_method

字符串

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

选项

  • "update"

  • "set"

  • "add"

rc_failed

列表 / 元素=整数

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

rc_succeeded

列表 / 元素=整数

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

state

字符串 / 必需

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

选项

  • "present"

  • "absent"

switchcontroller_lldpprofile

字典

设置的顶级参数。

802_1_tlvs

别名:802.1-tlvs

列表 / 元素=字符串

传输的 IEEE 802。

选项

  • "port-vlan-id"

802_3_tlvs

别名:802.3-tlvs

列表 / 元素=字符串

传输的 IEEE 802。

选项

  • "max-frame-size"

  • "power-negotiation"

auto_isl

别名:auto-isl

字符串

启用/禁用自动交换机间 LAG。

选项

  • "disable"

  • "enable"

auto_isl_auth

别名:auto-isl-auth

字符串

自动交换机间 LAG 身份验证模式。

选项

  • "legacy"

  • "strict"

  • "relax"

auto_isl_auth_encrypt

别名:auto-isl-auth-encrypt

字符串

自动交换机间 LAG 加密模式。

选项

  • "none"

  • "mixed"

  • "must"

auto_isl_auth_identity

别名:auto-isl-auth-identity

字符串

自动交换机间 LAG 身份验证标识。

auto_isl_auth_macsec_profile

别名:auto-isl-auth-macsec-profile

字符串

用于加密的自动交换机间 LAG macsec 配置文件。

auto_isl_auth_reauth

别名:auto-isl-auth-reauth

整数

自动交换机间 LAG 身份验证重新认证周期(秒)

auto_isl_auth_user

别名:auto-isl-auth-user

字符串

自动交换机间 LAG 身份验证用户证书。

auto_isl_hello_timer

别名:auto-isl-hello-timer

整数

自动交换机间 LAG hello 定时器持续时间

auto_isl_port_group

别名:auto-isl-port-group

整数

自动交换机间 LAG 端口组 ID

auto_isl_receive_timeout

别名:auto-isl-receive-timeout

整数

如果未收到响应,则自动交换机间 LAG 超时

auto_mclag_icl

别名:auto-mclag-icl

字符串

启用/禁用 MCLAG 机箱间链路。

选项

  • "disable"

  • "enable"

custom_tlvs

别名:custom-tlvs

列表 / 元素=字典

自定义 tlvs。

information_string

别名:information-string

字符串

组织定义的信息字符串

name

字符串

TLV 名称

oui

字符串

组织唯一标识符

subtype

整数

组织定义的子类型

med_location_service

别名:med-location-service

列表 / 元素=字典

Med 位置服务。

name

字符串

位置服务类型名称。

status

字符串

启用或禁用此 TLV。

选项

  • "disable"

  • "enable"

sys_location_id

别名:sys-location-id

字符串

位置服务 ID。

med_network_policy

别名:med-network-policy

列表 / 元素=字典

Med 网络策略。

assign_vlan

别名:assign-vlan

字符串

在此配置文件应用于受管理的 FortiSwitch 端口时,启用/禁用 VLAN 分配。

选项

  • "disable"

  • "enable"

dscp

整数

广告分级服务代码点

名称

字符串

策略类型名称。

优先级

整数

通告的二层优先级

状态

字符串

启用或禁用此 TLV。

选项

  • "disable"

  • "enable"

vlan

整数

如果在端口上配置,则通告VLAN的ID

vlan_intf

别名:vlan-intf

字符串

要通告的VLAN接口;如果在端口上配置。

med_tlvs

别名:med-tlvs

列表 / 元素=字符串

传输的LLDP-MED TLVs

选项

  • “库存管理”

  • “网络策略”

  • “电源管理”

  • “位置识别”

名称

字符串 / 必需

配置文件名称。

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: Configure FortiSwitch LLDP profiles.
      fortinet.fortimanager.fmgr_switchcontroller_lldpprofile:
        # 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>
        state: present # <value in [present, absent]>
        switchcontroller_lldpprofile:
          802_1_tlvs:
            - "port-vlan-id"
          802_3_tlvs:
            - "max-frame-size"
            - "power-negotiation"
          auto_isl: <value in [disable, enable]>
          auto_isl_hello_timer: <integer>
          auto_isl_port_group: <integer>
          auto_isl_receive_timeout: <integer>
          custom_tlvs:
            -
              information_string: <string>
              name: <string>
              oui: <string>
              subtype: <integer>
          med_network_policy:
            -
              dscp: <integer>
              name: <string>
              priority: <integer>
              status: <value in [disable, enable]>
              vlan: <integer>
              vlan_intf: <string>
              assign_vlan: <value in [disable, enable]>
          med_tlvs:
            - "inventory-management"
            - "network-policy"
            - "power-management"
            - "location-identification"
          name: <string>
          med_location_service:
            -
              name: <string>
              status: <value in [disable, enable]>
              sys_location_id: <string>
          auto_mclag_icl: <value in [disable, enable]>
          auto_isl_auth: <value in [legacy, strict, relax]>
          auto_isl_auth_encrypt: <value in [none, mixed, must]>
          auto_isl_auth_identity: <string>
          auto_isl_auth_macsec_profile: <string>
          auto_isl_auth_reauth: <integer>
          auto_isl_auth_user: <string>

返回值

公共返回值已在此处记录,以下是此模块特有的字段

描述

元数据

字典

请求的结果。

返回:始终

request_url

字符串

请求的完整URL。

返回:始终

示例: "/sys/login/user"

response_code

整数

API请求的状态。

返回:始终

示例: 0

response_data

列表 / 元素=字符串

API响应。

返回:始终

response_message

字符串

API响应的描述性消息。

返回:始终

示例: "OK."

system_information

字典

目标系统的信息。

返回:始终

rc

整数

请求的状态。

返回:始终

示例: 0

version_check_warning

列表 / 元素=字符串

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

返回:复杂

作者

  • 杜欣伟 (@dux-fortinet)

  • 李兴 (@lix-fortinet)

  • 薛杰 (@JieX19)

  • 郑凌 (@chillancezen)

  • 沈方 (@fshen01)

  • 卢宏斌 (@fgtdev-hblu)