fortinet.fortios.fortios_system_automation_trigger 模块 – 用于 Fortinet FortiOS 和 FortiGate 自动化连接的触发器。

注意

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

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

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

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

fortinet.fortios 2.0.0 中的新增功能

概要

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

state

字符串 / 必填

指示是创建还是删除对象。

选项

  • "present"

  • "absent"

system_automation_trigger

字典

自动化连接的触发器。

description

字符串

描述。

event_type

字符串

事件类型。

选项

  • "ioc"

  • "event-log"

  • "reboot"

  • "low-memory"

  • "high-cpu"

  • "license-near-expiry"

  • "local-cert-near-expiry"

  • "ha-failover"

  • "config-change"

  • "security-rating-summary"

  • "virus-ips-db-updated"

  • "faz-event"

  • "incoming-webhook"

  • "fabric-event"

  • "ips-logs"

  • "anomaly-logs"

  • "virus-logs"

  • "ssh-logs"

  • "webfilter-violation"

  • "traffic-violation"

fabric_event_name

字符串

Fabric 连接器事件处理程序名称。

fabric_event_severity

字符串

Fabric 连接器事件严重性。

faz_event_name

字符串

FortiAnalyzer 事件处理程序名称。

faz_event_severity

字符串

FortiAnalyzer 事件严重性。

faz_event_tags

字符串

FortiAnalyzer 事件标签。

fields

列表 / 元素=字典

自定义触发器字段设置。

id

整数 / 必填

条目 ID。请参阅 注释

name

字符串

名称。

value

字符串

值。

ioc_level

字符串

IOC 威胁级别。

选项

  • "medium"

  • "high"

license_type

字符串

许可证类型。

选项

  • "forticare-support"

  • "fortiguard-webfilter"

  • "fortiguard-antispam"

  • "fortiguard-antivirus"

  • "fortiguard-ips"

  • "fortiguard-management"

  • "forticloud"

  • "any"

logid

列表 / 元素=字典

触发事件的日志 ID。

id

整数 / 必填

日志 ID。请参阅 注释

name

字符串 / 必填

名称。

report_type

字符串

安全评级报告。

选项

  • "posture"

  • "coverage"

  • "optimization"

  • "any"

  • "PostureReport"

  • "CoverageReport"

  • "OptimizationReport"

serial

字符串

Fabric 连接器序列号。

trigger_datetime

字符串

触发日期和时间 (YYYY-MM-DD HH:MM:SS)。

trigger_day

整数

触发月份中的日期。

trigger_frequency

字符串

计划的触发频率。

选项

  • "hourly"

  • "daily"

  • "weekly"

  • "monthly"

  • "once"

trigger_hour

整数

触发的一天中的小时数 (0 - 23)。

trigger_minute

整数

触发的小时中的分钟数 (0 - 59)。

trigger_type

字符串

触发器类型。

选项

  • "event-based"

  • "scheduled"

trigger_weekday

字符串

触发器的工作日。

选项

  • "sunday"

  • "monday"

  • "tuesday"

  • "wednesday"

  • "thursday"

  • "friday"

  • "saturday"

vdom

列表 / 元素=字典

此触发器有效的虚拟域。

name

字符串 / 必填

虚拟域名称。源系统.vdom.name。

vdom

字符串

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

默认值: "root"

注释

注意

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

  • 该模块支持 check_mode。

示例

- name: Trigger for automation stitches.
  fortinet.fortios.fortios_system_automation_trigger:
      vdom: "{{ vdom }}"
      state: "present"
      access_token: "<your_own_value>"
      system_automation_trigger:
          description: "<your_own_value>"
          event_type: "ioc"
          fabric_event_name: "<your_own_value>"
          fabric_event_severity: "<your_own_value>"
          faz_event_name: "<your_own_value>"
          faz_event_severity: "<your_own_value>"
          faz_event_tags: "<your_own_value>"
          fields:
              -
                  id: "11"
                  name: "default_name_12"
                  value: "<your_own_value>"
          ioc_level: "medium"
          license_type: "forticare-support"
          logid:
              -
                  id: "17"
          name: "default_name_18"
          report_type: "posture"
          serial: "<your_own_value>"
          trigger_datetime: "<your_own_value>"
          trigger_day: "1"
          trigger_frequency: "hourly"
          trigger_hour: "0"
          trigger_minute: "0"
          trigger_type: "event-based"
          trigger_weekday: "sunday"
          vdom:
              -
                  name: "default_name_29 (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)