fortinet.fortios.fortios_system_standalone_cluster 模块 – 在 Fortinet 的 FortiOS 和 FortiGate 中配置 FortiGate 会话生命周期支持协议 (FGSP) 集群属性。

注意

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

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

要安装它,请使用:ansible-galaxy collection install fortinet.fortios。您需要进一步的要求才能使用此模块,请参阅 要求 以获取详细信息。

要在剧本中使用它,请指定:fortinet.fortios.fortios_system_standalone_cluster

fortinet.fortios 2.0.0 中的新增功能

概要

  • 此模块能够通过允许用户设置和修改系统功能和 standalone_cluster 类别来配置 FortiGate 或 FortiOS (FOS) 设备。示例包括所有参数和值,需要在使用前调整为数据源。使用 FOS v6.0.0 进行测试。

要求

执行此模块的主机需要满足以下要求。

  • ansible>=2.15

参数

参数

注释

access_token

string

基于令牌的身份验证。从 Fortigate 的 GUI 生成。

enable_log

boolean

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

选项

  • false ← (默认)

  • true

member_path

string

要操作的成员属性路径。

如果存在多个属性,则用斜杠字符分隔。

使用 member_path 标记的参数对于执行成员操作是合法的。

member_state

string

在指定属性路径下添加或删除成员。

当指定 member_state 时,将忽略 state 选项。

选项

  • "present"

  • "absent"

system_standalone_cluster

dictionary

配置 FortiGate 会话生命周期支持协议 (FGSP) 集群属性。

asymmetric_traffic_control

string

非对称流量控制模式。

选项

  • "cps-preferred"

  • "strict-anti-replay"

cluster_peer

list / elements=dictionary

配置 FortiGate 会话生命周期支持协议 (FGSP) 会话同步。

down_intfs_before_sess_sync

list / elements=dictionary

在会话同步完成之前要关闭的接口列表。

name

string / required

接口名称。源 system.interface.name。

hb_interval

integer

心跳间隔(1 - 20 (100*ms)。增加以减少误报。

hb_lost_threshold

integer

丢失心跳阈值 (1 - 60)。增加以减少误报。

ipsec_tunnel_sync

string

启用/禁用 IPsec 隧道同步。

选项

  • "enable"

  • "disable"

peerip

string

对等单元上用于会话同步链接的接口的 IP 地址。

peervd

string

包含对等单元上会话同步链接接口的 VDOM。通常,两个对等单元将具有相同的 peervd。源 system.vdom.name。

secondary_add_ipsec_routes

string

在备份单元上启用/禁用 IKE 路由通告。

选项

  • "enable"

  • "disable"

session_sync_filter

dictionary

如果您只想同步某些会话,请添加一个或多个过滤器。使用过滤器配置要同步的会话类型。

custom_service

list / elements=dictionary

仅同步使用这些自定义服务的会话。使用源端口和目标端口范围来定义这些自定义服务。

dst_port_range

string

自定义服务目标端口范围。

id

integer / required

自定义服务 ID。请参阅 <a href=’#notes’>注释</a>。

src_port_range

string

自定义服务源端口范围。

dstaddr

string

仅同步到此 IPv4 地址的会话。

dstaddr6

string

仅同步到此 IPv6 地址的会话。

dstintf

string

仅同步到此接口的会话。源 system.interface.name。

srcaddr

string

仅同步来自此 IPv4 地址的会话。

srcaddr6

string

仅同步来自此 IPv6 地址的会话。

srcintf

string

仅同步来自此接口的会话。源 system.interface.name。

sync_id

integer / required

同步 ID。请参阅 <a href=’#notes’>注释</a>。

syncvd

list / elements=dictionary

来自这些 VDOM 的会话使用此会话同步配置进行同步。

name

string / required

VDOM 名称。源 system.vdom.name。

encryption

string

在同步会话时启用/禁用加密。

选项

  • "enable"

  • "disable"

group_member_id

integer

集群成员 ID (0 - 15)。

layer2_connection

string

指示 FGSP 成员之间是否存在第 2 层连接。

选项

  • "available"

  • "unavailable"

monitor_interface

list / elements=dictionary

配置一个接口列表,用于监控自身。监控操作针对接口的状态执行。

name

string / required

接口名称。源 system.interface.name。

pingsvr_monitor_interface

list / elements=dictionary

用于检查远程 IP 监控的 pingsvr 监控接口列表。

name

string / required

接口名称。源 system.interface.name。

psksecret

string

用于会话同步的预共享密钥(ASCII 字符串或以 0x 开头的十六进制编码)。

session_sync_dev

列表 / 元素=字符串

将会话同步进程卸载到内核,并使用直接连接的接口同步会话。源系统.接口.名称。

standalone_group_id

integer

集群组 ID (0 - 255)。所有成员必须相同。

vdom

string

虚拟域,在之前定义的那些之中。vdom 是 FortiGate 的一个虚拟实例,可以配置并用作不同的单元。

默认值: "root"

注释

注意

  • 旧版的 fortiosapi 已被弃用,httpapi 是运行 playbook 的首选方式

示例

- name: Configure FortiGate Session Life Support Protocol (FGSP) cluster attributes.
  fortinet.fortios.fortios_system_standalone_cluster:
      vdom: "{{ vdom }}"
      system_standalone_cluster:
          asymmetric_traffic_control: "cps-preferred"
          cluster_peer:
              -
                  down_intfs_before_sess_sync:
                      -
                          name: "default_name_6 (source system.interface.name)"
                  hb_interval: "2"
                  hb_lost_threshold: "10"
                  ipsec_tunnel_sync: "enable"
                  peerip: "<your_own_value>"
                  peervd: "<your_own_value> (source system.vdom.name)"
                  secondary_add_ipsec_routes: "enable"
                  session_sync_filter:
                      custom_service:
                          -
                              dst_port_range: "<your_own_value>"
                              id: "16"
                              src_port_range: "<your_own_value>"
                      dstaddr: "<your_own_value>"
                      dstaddr6: "<your_own_value>"
                      dstintf: "<your_own_value> (source system.interface.name)"
                      srcaddr: "<your_own_value>"
                      srcaddr6: "<your_own_value>"
                      srcintf: "<your_own_value> (source system.interface.name)"
                  sync_id: "<you_own_value>"
                  syncvd:
                      -
                          name: "default_name_26 (source system.vdom.name)"
          encryption: "enable"
          group_member_id: "0"
          layer2_connection: "available"
          monitor_interface:
              -
                  name: "default_name_31 (source system.interface.name)"
          pingsvr_monitor_interface:
              -
                  name: "default_name_33 (source system.interface.name)"
          psksecret: "<your_own_value>"
          session_sync_dev: "<your_own_value> (source system.interface.name)"
          standalone_group_id: "0"

返回值

常见的返回值已在此处记录 此处,以下是此模块独有的字段

描述

build

string

FortiGate 镜像的版本号

返回值: 总是

示例: "1547"

http_method

string

上次用于将内容配置到 FortiGate 的方法

返回值: 总是

示例: "PUT"

http_status

string

FortiGate 在上次应用的操作中给出的最后结果

返回值: 总是

示例: "200"

mkey

string

上次调用 FortiGate 时使用的主键(id)

返回值: 成功

示例: "id"

name

string

用于满足请求的表名称

返回值: 总是

示例: "urlfilter"

path

string

用于满足请求的表的路径

返回值: 总是

示例: "webfilter"

revision

string

内部修订号

返回值: 总是

示例: "17.0.2.10658"

serial

string

设备的序列号

返回值: 总是

示例: "FGVMEVYYQT3AB5352"

status

string

指示操作结果

返回值: 总是

示例: "success"

vdom

string

使用的虚拟域

返回值: 总是

示例: "root"

version

string

FortiGate 的版本

返回值: 总是

示例: "v5.6.3"

作者

  • Link Zheng (@chillancezen)

  • Jie Xue (@JieX19)

  • Hongbin Lu (@fgtdev-hblu)

  • Frank Shen (@frankshen01)

  • Miguel Angel Munoz (@mamunozgonzalez)

  • Nicolas Thomas (@thomnico)