fortinet.fortimanager.fmgr_fmupdate_fdssetting 模块 – 配置 FortiGuard 设置。

注意

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

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

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

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

fortinet.fortimanager 2.0.0 中的新增功能

概要

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

  • 示例包含所有需要在使用前调整为数据源的参数和值。

参数

参数

注释

access_token

字符串

无需使用用户名和密码即可访问 FortiManager 的令牌。

bypass_validation

布尔值

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

选项

  • false ← (默认)

  • true

enable_log

布尔值

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

选项

  • false ← (默认)

  • true

fmupdate_fdssetting

字典

设置的顶级参数。

fds_clt_ssl_protocol

别名:fds-clt-ssl-protocol

字符串

连接 fds 服务器的 SSL 协议版本

sslv3 - 设置 SSLv3 为客户端版本。

tlsv1。

tlsv1。

tlsv1。

选项

  • "sslv3"

  • "tlsv1.0"

  • "tlsv1.1"

  • "tlsv1.2"

  • "tlsv1.3"

fds_ssl_protocol

别名:fds-ssl-protocol

字符串

接收 fgt 连接的 SSL 协议版本

sslv3 - 设置 SSLv3 为最低版本。

tlsv1。

tlsv1。

tlsv1。

选项

  • "sslv3"

  • "tlsv1.0"

  • "tlsv1.1"

  • "tlsv1.2"

  • "tlsv1.3"

fmtr_log

别名:fmtr-log

字符串

fmtr 日志级别

emergency - 日志级别 - 紧急

alert - 日志级别 - 警报

critical - 日志级别 - 严重错误

error - 日志级别 - 错误

warn - 日志级别 - 警告

notice - 日志级别 - 通知

info - 日志级别 - 信息

debug - 日志级别 - 调试

disable - 禁用 linkd 日志

选项

  • "emergency"

  • "alert"

  • "critical"

  • "error"

  • "warn"

  • "notice"

  • "info"

  • "debug"

  • "disable"

fortiguard_anycast

别名:fortiguard-anycast

字符串

启用/禁用使用 FortiGuard 的 anycast 网络

disable - 禁用设置。

enable - 启用设置。

选项

  • "disable"

  • "enable"

fortiguard_anycast_source

别名:fortiguard-anycast-source

字符串

配置 FortiGuard anycast 网络中哪个 Fortinet 服务器提供 FortiGuard 服务。

fortinet - 使用 Fortinet 的服务器在 FortiGuard 的 anycast 网络中提供 FortiGuard 服务。

aws - 使用 Fortinet 的 AWS 服务器在 FortiGuard 的 anycast 网络中提供 FortiGuard 服务。

选项

  • "fortinet"

  • "aws"

linkd_log

别名:linkd-log

字符串

linkd 日志级别

emergency - 日志级别 - 紧急

alert - 日志级别 - 警报

critical - 日志级别 - 严重错误

error - 日志级别 - 错误

warn - 日志级别 - 警告

notice - 日志级别 - 通知

info - 日志级别 - 信息

debug - 日志级别 - 调试

disable - 禁用 linkd 日志

选项

  • "emergency"

  • "alert"

  • "critical"

  • "error"

  • "warn"

  • "notice"

  • "info"

  • "debug"

  • "disable"

max_av_ips_version

别名:max-av-ips-version

整数

可下载的完整版 AV/IPS 软件包的最大数量

max_work

别名:max-work

整数

处理下载请求的工作程序最大数量

push_override

别名:push-override

字典

推送覆盖。

ip

字符串

将推送消息转发到 FortiManager 单元的 NAT 设备的外部或虚拟 IP 地址。

port

整数

NAT 设备上的接收端口号

status

字符串

启用/禁用客户端的推送更新

disable - 禁用设置。

enable - 启用设置。

选项

  • "disable"

  • "enable"

push_override_to_client

别名:push-override-to-client

字典

推送覆盖到客户端。

announce_ip

别名:announce-ip

列表 / 元素=字典

公告 IP。

id

整数

公告IP地址的ID

ip

字符串

公告IPv4地址。

port

整数

公告IP端口

status

字符串

启用/禁用推送更新

disable - 禁用设置。

enable - 启用设置。

选项

  • "disable"

  • "enable"

send_report

字符串

将报告/fssi发送到fds服务器。

disable - 禁用设置。

enable - 启用设置。

选项

  • "disable"

  • "enable"

send_setup

字符串

将设置转发到fds服务器。

disable - 禁用设置。

enable - 启用设置。

选项

  • "disable"

  • "enable"

server_override

别名:server-override

字典

服务器覆盖。

servlist

列表 / 元素=字典

服务列表。

id

整数

覆盖服务器ID

ip

字符串

覆盖服务器的IPv4地址。

ip6

字符串

覆盖服务器的IPv6地址。

port

整数

联系FortiGuard时使用的端口号

service_type

别名:service-type

任意

(列表或字符串)

覆盖服务类型。

fds - fds的服务器覆盖配置

fct - fct的服务器覆盖配置

选项

  • "fds"

  • "fct"

  • "fai"

status

字符串

覆盖状态。

disable - 禁用设置。

enable - 启用设置。

选项

  • "disable"

  • "enable"

system_support_fai

别名:system-support-fai

列表 / 元素=字符串

支持的FortiNDR版本。

选项

  • "7.x"

system_support_faz

别名:system-support-faz

列表 / 元素=字符串

支持的FortiAnalyzer版本。

选项

  • "6.x"

  • "7.x"

system_support_fct

别名:system-support-fct

列表 / 元素=字符串

支持的FortiClient版本。

选项

  • "4.x"

  • "5.0"

  • "5.2"

  • "5.4"

  • "5.6"

  • "6.0"

  • "6.2"

  • "6.4"

  • "7.0"

  • "7.2"

system_support_fdc

别名:system-support-fdc

列表 / 元素=字符串

支持的FortiDeceptor版本。

选项

  • "3.x"

  • "4.x"

  • "5.x"

  • "6.x"

system_support_fgt

别名:system-support-fgt

列表 / 元素=字符串

支持的FortiOS版本。

选项

  • "5.4"

  • "5.6"

  • "6.0"

  • "6.2"

  • "6.4"

  • "7.0"

  • "7.2"

  • "7.4"

  • "7.6"

system_support_fis

别名:system-support-fis

列表 / 元素=字符串

支持的FortiIsolator版本。

选项

  • "1.x"

  • "2.x"

system_support_fml

别名:system-support-fml

列表 / 元素=字符串

支持的FortiMail版本。

选项

  • "4.x"

  • "5.x"

  • "6.x"

  • "6.0"

  • "6.2"

  • "6.4"

  • "7.0"

  • "7.2"

  • "7.x"

system_support_fsa

别名:system-support-fsa

列表 / 元素=字符串

支持的FortiSandbox版本。

选项

  • "1.x"

  • "2.x"

  • "3.x"

  • "4.x"

  • "3.0"

  • "3.1"

  • "3.2"

system_support_fsw

别名:system-support-fsw

列表 / 元素=字符串

支持的FortiSwitch版本。

选项

  • "5.4"

  • "5.6"

  • "6.0"

  • "6.2"

  • "4.x"

  • "5.0"

  • "5.2"

  • "6.4"

system_support_fts

别名:system-support-fts

列表 / 元素=字符串

支持的FortiTester版本。

选项

  • "3.x"

  • "4.x"

  • "7.x"

umsvc_log

别名:umsvc-log

字符串

um_service日志级别

emergency - 日志级别 - 紧急

alert - 日志级别 - 警报

critical - 日志级别 - 严重错误

error - 日志级别 - 错误

warn - 日志级别 - 警告

notice - 日志级别 - 通知

info - 日志级别 - 信息

debug - 日志级别 - 调试

disable - 禁用 linkd 日志

选项

  • "emergency"

  • "alert"

  • "critical"

  • "error"

  • "warn"

  • "notice"

  • "info"

  • "debug"

  • "disable"

unreg_dev_option

别名:unreg-dev-option

字符串

设置注销设备的选项

忽略 - 忽略所有未注册的设备。

仅服务 - 允许更新请求而不添加设备。

添加服务 - 添加未注册的设备并允许更新请求。

选项

  • "忽略"

  • "仅服务"

  • "添加服务"

update_schedule

别名:update-schedule

字典

更新计划。

day

字符串

如果频率为每周,则配置更新将发生的那一天

星期日 - 每周日更新。

星期一 - 每周一更新。

星期二 - 每周二更新。

星期三 - 每周三更新。

星期四 - 每周四更新。

星期五 - 每周五更新。

星期六 - 每周六更新。

选项

  • "星期日"

  • "星期一"

  • "星期二"

  • "星期三"

  • "星期四"

  • "星期五"

  • "星期六"

frequency

字符串

配置更新频率

每 - 时间间隔。

每日 - 每天。

每周 - 每周。

选项

  • "每"

  • "每日"

  • "每周"

status

字符串

启用/禁用计划更新。

disable - 禁用设置。

enable - 启用设置。

选项

  • "disable"

  • "enable"

time

任意

(列表) 更新之间的时间间隔,或更新发生的小时和分钟

User_Agent

别名:User-Agent

字符串

配置用户代理字符串。

wanip_query_mode

别名:wanip-query-mode

字符串

公共IP查询模式

禁用 - 不查询公共IP

ipify - 通过https获取公共IP

选项

  • "disable"

  • "ipify"

forticloud_access_token

字符串

使用FortiCloud API访问令牌验证Ansible客户端。

proposed_method

字符串

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

选项

  • "更新"

  • "设置"

  • "添加"

rc_failed

列表 / 元素=整数

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

rc_succeeded

列表 / 元素=整数

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

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有助于完成此工作。

  • 通常,当返回非零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 FortiGuard settings.
      fortinet.fortimanager.fmgr_fmupdate_fdssetting:
        # 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, ...]
        fmupdate_fdssetting:
          User_Agent: <string>
          fds_clt_ssl_protocol: <value in [sslv3, tlsv1.0, tlsv1.1, ...]>
          fds_ssl_protocol: <value in [sslv3, tlsv1.0, tlsv1.1, ...]>
          fmtr_log: <value in [emergency, alert, critical, ...]>
          linkd_log: <value in [emergency, alert, critical, ...]>
          max_av_ips_version: <integer>
          max_work: <integer>
          push_override:
            ip: <string>
            port: <integer>
            status: <value in [disable, enable]>
          push_override_to_client:
            announce_ip:
              -
                id: <integer>
                ip: <string>
                port: <integer>
            status: <value in [disable, enable]>
          send_report: <value in [disable, enable]>
          send_setup: <value in [disable, enable]>
          server_override:
            servlist:
              -
                id: <integer>
                ip: <string>
                ip6: <string>
                port: <integer>
                service_type: # <list or string>
                  - "fds"
                  - "fct"
                  - "fai"
            status: <value in [disable, enable]>
          system_support_fct:
            - "4.x"
            - "5.0"
            - "5.2"
            - "5.4"
            - "5.6"
            - "6.0"
            - "6.2"
            - "6.4"
            - "7.0"
            - "7.2"
          system_support_fgt:
            - "5.4"
            - "5.6"
            - "6.0"
            - "6.2"
            - "6.4"
            - "7.0"
            - "7.2"
            - "7.4"
            - "7.6"
          system_support_fml:
            - "4.x"
            - "5.x"
            - "6.x"
            - "6.0"
            - "6.2"
            - "6.4"
            - "7.0"
            - "7.2"
            - "7.x"
          system_support_fsa:
            - "1.x"
            - "2.x"
            - "3.x"
            - "4.x"
            - "3.0"
            - "3.1"
            - "3.2"
          system_support_fsw:
            - "5.4"
            - "5.6"
            - "6.0"
            - "6.2"
            - "4.x"
            - "5.0"
            - "5.2"
            - "6.4"
          umsvc_log: <value in [emergency, alert, critical, ...]>
          unreg_dev_option: <value in [ignore, svc-only, add-service]>
          update_schedule:
            day: <value in [Sunday, Monday, Tuesday, ...]>
            frequency: <value in [every, daily, weekly]>
            status: <value in [disable, enable]>
            time: <list or string>
          wanip_query_mode: <value in [disable, ipify]>
          fortiguard_anycast: <value in [disable, enable]>
          fortiguard_anycast_source: <value in [fortinet, aws]>
          system_support_fdc:
            - "3.x"
            - "4.x"
            - "5.x"
            - "6.x"
          system_support_fts:
            - "3.x"
            - "4.x"
            - "7.x"
          system_support_faz:
            - "6.x"
            - "7.x"
          system_support_fis:
            - "1.x"
            - "2.x"
          system_support_fai:
            - "7.x"

返回值

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

描述

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

列表 / 元素=字符串

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

返回:复杂

作者

  • 杜欣伟 (@dux-fortinet)

  • 李星 (@lix-fortinet)

  • 薛杰 (@JieX19)

  • 郑链 (@chillancezen)

  • 沈峰 (@fshen01)

  • 卢洪斌 (@fgtdev-hblu)