fortinet.fortimanager.fmgr_system_sql 模块 – SQL 设置。
注意
此模块是 fortinet.fortimanager 集合 (版本 2.8.2) 的一部分。
如果您使用的是 ansible 包,则可能已安装此集合。它不包含在 ansible-core 中。要检查它是否已安装,请运行 ansible-galaxy collection list。
要安装它,请使用: ansible-galaxy collection install fortinet.fortimanager。
要在playbook中使用它,请指定: fortinet.fortimanager.fmgr_system_sql。
fortinet.fortimanager 2.0.0 中的新增功能
概要
- 此模块能够配置FortiManager设备。 
- 示例包括所有需要在使用前调整为数据源的参数和值。 
参数
| 参数 | 注释 | 
|---|---|
| 无需使用用户名和密码即可访问FortiManager的令牌。 | |
| 仅当模块模式与FortiManager API结构不同时才设置为True,模块将继续执行而无需验证参数。 选项 
 | |
| 启用/禁用任务的日志记录。 选项 
 | |
| 使用FortiCloud API访问令牌验证Ansible客户端。 | |
| 底层Json RPC请求的覆盖方法。 选项 
 | |
| 将覆盖失败条件的rc代码列表。 | |
| 将覆盖成功条件的rc代码列表。 | |
| 设置的顶级参数。 | |
| 禁用/启用在后台重建SQL数据库。 disable - 不要在后台重建SQL数据库。 enable - 在后台重建SQL数据库。 选项 
 | |
| 需要压缩的SQL表的最小日期(天)。 | |
| 自定义索引。 | |
| 禁用/启用区分大小写的索引。 disable - 构建不区分大小写的索引。 enable - 构建区分大小写的索引。 选项 
 | |
| 设备类型。 FortiGate - 设备类型设置为FortiGate。 FortiManager - 将设备类型设置为FortiManager FortiClient - 将设备类型设置为FortiClient FortiMail - 设备类型设置为FortiMail。 FortiWeb - 设备类型设置为FortiWeb。 FortiCache - 将设备类型设置为FortiCache FortiSandbox - 将设备类型设置为FortiSandbox FortiDDoS - 将设备类型设置为FortiDDoS FortiAuthenticator - 将设备类型设置为FortiAuthenticator FortiProxy - 将设备类型设置为FortiProxy 选项 
 | |
| 添加或编辑日志索引字段。 | |
| 要索引的日志字段名称。 | |
| 日志类型。 none - 无 app-ctrl attack content dlp emailfilter event generic history traffic virus voip webfilter netscan fct-event fct-traffic fct-netscan waf gtp dns ssh ssl 选项 
 | |
| 自定义skipidx。 | |
| 设备类型。 FortiGate - 将设备类型设置为FortiGate。 FortiManager - 将设备类型设置为FortiManager FortiClient - 将设备类型设置为FortiClient。 FortiMail - 将设备类型设置为FortiMail。 FortiWeb - 将设备类型设置为FortiWeb。 FortiSandbox - 将设备类型设置为FortiSandbox FortiProxy - 将设备类型设置为FortiProxy 选项 
 | |
| 添加或编辑日志索引字段。 | |
| 要添加到跳过索引的字段。 | |
| 日志类型。 app-ctrl attack content dlp emailfilter event generic history traffic virus voip webfilter netscan fct-event fct-traffic fct-netscan waf gtp dns ssh ssl file-filter asset 选项 
 | |
| 数据库名称。 | |
| 数据库类型。 mysql - MySQL数据库。 postgres - PostgreSQL本地数据库。 选项 
 | |
| 如果已注册设备的数量大于8000,则必须设置为enable。 disable - 如果设备数量小于8000,则设置为disable。 enable - 如果设备数量等于或大于8000,则设置为enable。 选项 
 | |
| SQL数据库表最大分区时间范围(分钟) | |
| SQL数据库表最大分区时间范围(分钟) | |
| 日志类型。 none - 无。 app-ctrl attack content dlp emailfilter event generic history traffic virus voip webfilter netscan fct-event fct-traffic fct-netscan waf gtp dns ssh ssl 选项 
 | |
| (列表) 用于登录远程数据库的密码。 | |
| 在 GUI 启动时提示将日志数据库转换为 SQL 数据库。 disable - 在 GUI 启动时不提示将日志数据库升级到 SQL 数据库。 enable - 在 GUI 启动时提示将日志数据库升级到 SQL 数据库。 选项 
 | |
| 在 SQL 数据库重建期间禁用/启用重建事件。 disable - 在 SQL 数据库重建期间不重建事件。 enable - 在 SQL 数据库重建期间重建事件。 选项 
 | |
| (列表) 重建事件的开始日期和时间 | |
| 数据库 IP 或主机名。 | |
| (列表) 开始日期和时间 | |
| SQL 数据库状态。 disable - 禁用 SQL 数据库。 local - 启用本地数据库。 选项 
 | |
| 禁用/启用全文搜索索引。 disable - 不创建全文搜索索引。 enable - 创建全文搜索索引。 选项 
 | |
| SQL数据库表最大分区时间范围(分钟) | |
| 时间戳索引字段。 | |
| 全文搜索索引字段的类别。 | |
| 全文搜索索引的字段。 | |
| 用于登录远程数据库的用户名。 | |
| SQL数据库表最大分区时间范围(分钟) | |
| 在工作区模式下运行 FortiManager 时要锁定的 ADOM,值可以是 global 和其他包括 root。 | |
| 等待其他用户释放工作区锁的最大时间(秒)。 默认值:  | 
注释
注意
- 从 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: SQL settings.
      fortinet.fortimanager.fmgr_system_sql:
        # 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, ...]
        system_sql:
          background_rebuild: <value in [disable, enable]>
          custom_index:
            -
              case_sensitive: <value in [disable, enable]>
              device_type: <value in [FortiGate, FortiManager, FortiClient, ...]>
              id: <integer>
              index_field: <string>
              log_type: <value in [none, app-ctrl, attack, ...]>
          database_name: <string>
          database_type: <value in [mysql, postgres]>
          device_count_high: <value in [disable, enable]>
          event_table_partition_time: <integer>
          fct_table_partition_time: <integer>
          logtype:
            - "none"
            - "app-ctrl"
            - "attack"
            - "content"
            - "dlp"
            - "emailfilter"
            - "event"
            - "generic"
            - "history"
            - "traffic"
            - "virus"
            - "voip"
            - "webfilter"
            - "netscan"
            - "fct-event"
            - "fct-traffic"
            - "fct-netscan"
            - "waf"
            - "gtp"
            - "dns"
            - "ssh"
            - "ssl"
            - "file-filter"
            - "asset"
            - "protocol"
            - "siem"
            - "ztna"
            - "security"
          password: <list or string>
          prompt_sql_upgrade: <value in [disable, enable]>
          rebuild_event: <value in [disable, enable]>
          rebuild_event_start_time: <list or string>
          server: <string>
          start_time: <list or string>
          status: <value in [disable, local]>
          text_search_index: <value in [disable, enable]>
          traffic_table_partition_time: <integer>
          ts_index_field:
            -
              category: <string>
              value: <string>
          username: <string>
          utm_table_partition_time: <integer>
          custom_skipidx:
            -
              device_type: <value in [FortiGate, FortiManager, FortiClient, ...]>
              id: <integer>
              index_field: <string>
              log_type: <value in [app-ctrl, attack, content, ...]>
          compress_table_min_age: <integer>
返回值
常用的返回值已在此处记录,以下是此模块独有的字段
| 键 | 描述 | 
|---|---|
| 请求的结果。 返回: 始终 | |
| 请求的完整 URL。 返回: 始终 示例:  | |
| API 请求的状态。 返回: 始终 示例:  | |
| API 响应。 返回: 始终 | |
| API 响应的描述性消息。 返回: 始终 示例:  | |
| 目标系统的信息。 返回: 始终 | |
| 请求的状态。 返回: 始终 示例:  | |
| 如果 playbook 中使用的参数不受当前 FortiManager 版本支持,则会发出警告。 返回: 复杂 | 
