fortinet.fortios.fortios_wanopt_cache_service 模块 – 在 Fortinet 的 FortiOS 和 FortiGate 中指定 WAN 优化和 Web 缓存的缓存服务。

注意

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

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

要安装它,请使用:ansible-galaxy collection install fortinet.fortios。 您需要其他要求才能使用此模块,请参阅 要求 了解详细信息。

要在 playbook 中使用它,请指定:fortinet.fortios.fortios_wanopt_cache_service

在 fortinet.fortios 2.0.0 中新增

概要

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

要求

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

  • ansible>=2.15

参数

参数

注释

access_token

字符串

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

enable_log

布尔值

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

选择

  • false ←(默认)

  • true

member_path

字符串

要操作的成员属性路径。

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

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

member_state

字符串

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

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

选择

  • "present"

  • "absent"

vdom

字符串

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

默认值: "root"

wanopt_cache_service

字典

指定 WAN 优化和 Web 缓存的缓存服务。

acceptable_connections

字符串

设置接受缓存协作连接时的策略。

选择

  • "any"

  • "peers"

collaboration

字符串

启用/禁用缓存服务集群之间的缓存协作。

选择

  • "enable"

  • "disable"

device_id

字符串

为此缓存设备设置标识符。

dst_peer

列表 / 元素=字典

修改缓存服务目标对等列表。

auth_type

整数

为此对等方设置身份验证类型。

device_id

字符串 / 必需

此对等方的设备 ID。

encode_type

整数

为此对等方设置编码类型。

ip

字符串

设置此对等方的集群 IP 地址。

priority

整数

为此对等方设置优先级。

prefer_scenario

字符串

设置首选的缓存行为,以平衡延迟和命中率。

选择

  • "balance"

  • "prefer-speed"

  • "prefer-cache"

src_peer

列表 / 元素=字典

修改缓存服务源对等列表。

auth_type

整数

为此对等方设置身份验证类型。

device_id

字符串 / 必需

此对等方的设备 ID。

encode_type

整数

为此对等方设置编码类型。

ip

字符串

设置此对等方的集群 IP 地址。

priority

整数

为此对等方设置优先级。

注释

注意

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

示例

- name: Designate cache-service for wan-optimization and webcache.
  fortinet.fortios.fortios_wanopt_cache_service:
      vdom: "{{ vdom }}"
      wanopt_cache_service:
          acceptable_connections: "any"
          collaboration: "enable"
          device_id: "<your_own_value>"
          dst_peer:
              -
                  auth_type: "0"
                  device_id: "<your_own_value>"
                  encode_type: "0"
                  ip: "<your_own_value>"
                  priority: "1"
          prefer_scenario: "balance"
          src_peer:
              -
                  auth_type: "0"
                  device_id: "<your_own_value>"
                  encode_type: "0"
                  ip: "<your_own_value>"
                  priority: "1"

返回值

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

描述

build

字符串

fortigate 映像的构建号

返回:总是

示例: "1547"

http_method

字符串

最后一次用于将内容配置到 FortiGate 中的方法

返回:总是

示例: "PUT"

http_status

字符串

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

返回:总是

示例: "200"

mkey

字符串

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

返回:成功

示例: "id"

name

字符串

用于满足请求的表的名称

返回:总是

示例: "urlfilter"

path

字符串

用于满足请求的表的路径

返回:总是

示例: "webfilter"

revision

字符串

内部修订号

返回:总是

示例: "17.0.2.10658"

serial

字符串

设备的序列号

返回:总是

示例: "FGVMEVYYQT3AB5352"

status

字符串

操作结果的指示

返回:总是

示例: "success"

vdom

字符串

使用的虚拟域

返回:总是

示例: "root"

version

字符串

FortiGate 的版本

返回:总是

示例: "v5.6.3"

作者

  • Link Zheng (@chillancezen)

  • 解 Xue (@JieX19)

  • 吕洪斌 (@fgtdev-hblu)

  • 沈 Frank (@frankshen01)

  • 米格尔·安吉尔·穆尼奥斯 (@mamunozgonzalez)

  • 尼古拉斯·托马斯 (@thomnico)