fortinet.fortios.fortios_system_central_management 模块 – 在 Fortinet 的 FortiOS 和 FortiGate 中配置中央管理。

注意

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

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

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

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

fortinet.fortios 2.0.0 中的新增功能

概要

  • 此模块能够通过允许用户设置和修改系统功能和 central_management 类别来配置 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"

system_central_management

字典

配置中央管理。

allow_monitor

字符串

启用/禁用允许中央管理服务器远程监控此 FortiGate 单位。

选项

  • "enable"

  • "disable"

allow_push_configuration

字符串

启用/禁用允许中央管理服务器将配置更改推送到此 FortiGate。

选项

  • "enable"

  • "disable"

allow_push_firmware

字符串

启用/禁用允许中央管理服务器将固件更新推送到此 FortiGate。

选项

  • "enable"

  • "disable"

allow_remote_firmware_upgrade

字符串

启用/禁用从中央管理服务器远程升级此 FortiGate 上的固件。

选项

  • "enable"

  • "disable"

ca_cert

字符串

FGFM 协议要使用的 CA 证书。

enc_algorithm

字符串

FortiGate 和中央管理之间通信的加密强度。

选项

  • "default"

  • "high"

  • "low"

fmg

字符串

FortiManager 的 IP 地址或 FQDN。

fmg_source_ip

字符串

此 FortiGate 与 FortiManager 通信时使用的 IPv4 源地址。

fmg_source_ip6

字符串

此 FortiGate 与 FortiManager 通信时使用的 IPv6 源地址。

fmg_update_port

字符串

用于与充当 FortiGuard 更新服务器的 FortiManager 通信的端口。

选项

  • "8890"

  • "443"

fortigate_cloud_sso_default_profile

字符串

覆盖访问配置文件。来源 system.accprofile.name。

include_default_servers

字符串

启用/禁用在覆盖服务器列表中包含公共 FortiGuard 服务器。

选项

  • "enable"

  • "disable"

interface

字符串

指定到达服务器的出站接口。来源 system.interface.name。

interface_select_method

字符串

指定如何选择到达服务器的出站接口。

选项

  • "auto"

  • "sdwan"

  • "specify"

local_cert

字符串

FGFM 协议要使用的证书。

mode

字符串

中央管理模式。

选项

  • "normal"

  • "backup"

schedule_config_restore

字符串

启用/禁用允许中央管理服务器恢复此 FortiGate 的配置。

选项

  • "enable"

  • "disable"

schedule_script_restore

字符串

启用/禁用允许中央管理服务器恢复存储在此 FortiGate 上的脚本。

选项

  • "enable"

  • "disable"

serial_number

字符串

序列号。

server_list

列表 / 元素=字典

FortiGate 可用于更新(对于 AV、IPS、更新)和评级(对于 Web 过滤和反垃圾邮件评级)服务器的附加服务器。

addr_type

字符串

指示 FortiGate 是否使用 IPv4 地址、IPv6 地址或 FQDN 与覆盖服务器通信。

选项

  • "ipv4"

  • "ipv6"

  • "fqdn"

fqdn

字符串

覆盖服务器的 FQDN 地址。

id

整数 / 必需

ID。参见 注释

server_address

字符串

覆盖服务器的 IPv4 地址。

server_address6

字符串

覆盖服务器的 IPv6 地址。

server_type

列表 / 元素=字符串

FortiGuard 服务类型。

选项

  • "update"

  • "rating"

  • "vpatch-query"

  • "iot-collect"

  • "iot-query"

type

字符串

中央管理类型。

选项

  • "fortimanager"

  • "fortiguard"

  • "none"

vdom

字符串

与 FortiManager 通信时要使用的虚拟域 (VDOM) 名称。来源 system.vdom.name。

vdom

字符串

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

默认值: "root"

注释

注意

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

示例

- name: Configure central management.
  fortinet.fortios.fortios_system_central_management:
      vdom: "{{ vdom }}"
      system_central_management:
          allow_monitor: "enable"
          allow_push_configuration: "enable"
          allow_push_firmware: "enable"
          allow_remote_firmware_upgrade: "enable"
          ca_cert: "<your_own_value>"
          enc_algorithm: "default"
          fmg: "<your_own_value>"
          fmg_source_ip: "<your_own_value>"
          fmg_source_ip6: "<your_own_value>"
          fmg_update_port: "8890"
          fortigate_cloud_sso_default_profile: "<your_own_value> (source system.accprofile.name)"
          include_default_servers: "enable"
          interface: "<your_own_value> (source system.interface.name)"
          interface_select_method: "auto"
          local_cert: "<your_own_value>"
          mode: "normal"
          schedule_config_restore: "enable"
          schedule_script_restore: "enable"
          serial_number: "<your_own_value>"
          server_list:
              -
                  addr_type: "ipv4"
                  fqdn: "<your_own_value>"
                  id: "25"
                  server_address: "<your_own_value>"
                  server_address6: "<your_own_value>"
                  server_type: "update"
          type: "fortimanager"
          vdom: "<your_own_value> (source system.vdom.name)"

返回值

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

描述

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"

作者

  • 郑琳 (@chillancezen)

  • 薛杰 (@JieX19)

  • 陆宏斌 (@fgtdev-hblu)

  • 沈方 (@frankshen01)

  • Miguel Angel Munoz (@mamunozgonzalez)

  • Nicolas Thomas (@thomnico)