fmgr_system_sql – SQL settings.

New in version 2.10.

Synopsis

  • This module is able to configure a FortiManager device.
  • Examples include all parameters and values need to be adjusted to data sources before usage.

Requirements

The below requirements are needed on the host that executes this module.

  • ansible>=2.9.0

FortiManager Version Compatibility


6.0.0 6.2.1 6.2.3 6.2.5 6.4.0 6.4.2 6.4.5 7.0.0 7.2.0
system_sql yes yes yes yes yes yes yes yes yes

Parameters

  • enable_log - Enable/Disable logging for task type: bool required: false default: False
  • forticloud_access_token - Access token of forticloud managed API users, this option is available with FortiManager later than 6.4.0 type: str required: false
  • proposed_method - The overridden method for the underlying Json RPC request type: str required: false choices: set, update, add
  • bypass_validation - Only set to True when module schema diffs with FortiManager API structure, module continues to execute without validating parameters type: bool required: false default: False
  • workspace_locking_adom - Acquire the workspace lock if FortiManager is running in workspace mode type: str required: false choices: global, custom adom including root
  • workspace_locking_timeout - The maximum time in seconds to wait for other users to release workspace lock type: integer required: false default: 300
  • rc_succeeded - The rc codes list with which the conditions to succeed will be overriden type: list required: false
  • rc_failed - The rc codes list with which the conditions to fail will be overriden type: list required: false
  • system_sql - no description type: dict
    • background-rebuild - Disable/Enable rebuild SQL database in the background. type: str choices: [disable, enable] default: enable more...
    • custom-index - Custom-Index. type: array more...
      • case-sensitive - Disable/Enable case sensitive index. type: str choices: [disable, enable] default: disable more...
      • device-type - Device type. type: str choices: [FortiGate, FortiManager, FortiClient, FortiMail, FortiWeb, FortiCache, FortiSandbox, FortiDDoS, FortiAuthenticator, FortiProxy] default: FortiGate more...
      • id - Add or Edit log index fields. type: int default: 0 more...
      • index-field - Log field name to be indexed. type: str more...
      • log-type - Log type. type: str choices: [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] default: traffic more...
    • database-name - Database name. type: str more...
    • database-type - Database type. type: str choices: [mysql, postgres] default: postgres more...
    • device-count-high - Must set to enable if the count of registered devices is greater than 8000. type: str choices: [disable, enable] default: disable more...
    • event-table-partition-time - Maximum SQL database table partitioning time range in minute (0 for unlimited) for event logs. type: int default: 0 more...
    • fct-table-partition-time - Maximum SQL database table partitioning time range in minute (0 for unlimited) for FortiClient logs. type: int default: 240 more...
    • logtype - Log type. type: array choices: [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] more...
    • password - Password for login remote database. type: str more...
    • prompt-sql-upgrade - Prompt to convert log database into SQL database at start time on GUI. type: str choices: [disable, enable] default: enable more...
    • rebuild-event - Disable/Enable rebuild event during SQL database rebuilding. type: str choices: [disable, enable] default: enable more...
    • rebuild-event-start-time - Rebuild event starting date and time . type: str more...
    • server - Database IP or hostname. type: str more...
    • start-time - Start date and time . type: str more...
    • status - SQL database status. type: str choices: [disable, local] default: local more...
    • text-search-index - Disable/Enable text search index. type: str choices: [disable, enable] default: disable more...
    • traffic-table-partition-time - Maximum SQL database table partitioning time range in minute (0 for unlimited) for traffic logs. type: int default: 0 more...
    • ts-index-field - Ts-Index-Field. type: array more...
      • category - Category of text search index fields. type: str more...
      • value - Fields of text search index. type: str more...
    • username - User name for login remote database. type: str more...
    • utm-table-partition-time - Maximum SQL database table partitioning time range in minute (0 for unlimited) for UTM logs. type: int default: 0 more...
    • custom-skipidx - Custom-Skipidx. type: array more...
      • device-type - Device type. type: str choices: [FortiGate, FortiManager, FortiClient, FortiMail, FortiWeb, FortiSandbox, FortiProxy] default: FortiGate more...
      • id - Add or Edit log index fields. type: int default: 0 more...
      • index-field - Field to be added to skip index. type: str more...
      • log-type - Log type. type: str choices: [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] default: app-ctrl more...
    • compress-table-min-age - Minimum age in days for SQL tables to be compressed. type: int default: 7 more...

Notes

Note

  • Running in workspace locking mode is supported in this FortiManager module, the top level parameters workspace_locking_adom and workspace_locking_timeout help do the work.
  • To create or update an object, use state: present directive.
  • To delete an object, use state: absent directive
  • Normally, running one module can fail when a non-zero rc is returned. you can also override the conditions to fail or succeed with parameters rc_failed and rc_succeeded

Examples

- hosts: fortimanager-inventory
  collections:
    - fortinet.fortimanager
  connection: httpapi
  vars:
     ansible_httpapi_use_ssl: True
     ansible_httpapi_validate_certs: False
     ansible_httpapi_port: 443
  tasks:
   - name: no description
     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: <value of integer>
                 index-field: <value of string>
                 log-type: <value in [none, app-ctrl, attack, ...]>
           database-name: <value of string>
           database-type: <value in [mysql, postgres]>
           device-count-high: <value in [disable, enable]>
           event-table-partition-time: <value of integer>
           fct-table-partition-time: <value of 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
           password: <value of string>
           prompt-sql-upgrade: <value in [disable, enable]>
           rebuild-event: <value in [disable, enable]>
           rebuild-event-start-time: <value of string>
           server: <value of string>
           start-time: <value of string>
           status: <value in [disable, local]>
           text-search-index: <value in [disable, enable]>
           traffic-table-partition-time: <value of integer>
           ts-index-field:
             -
                 category: <value of string>
                 value: <value of string>
           username: <value of string>
           utm-table-partition-time: <value of integer>
           custom-skipidx:
             -
                 device-type: <value in [FortiGate, FortiManager, FortiClient, ...]>
                 id: <value of integer>
                 index-field: <value of string>
                 log-type: <value in [app-ctrl, attack, content, ...]>
           compress-table-min-age: <value of integer>

Return Values

Common return values are documented: https://docs.ansible.com/ansible/latest/reference_appendices/common_return_values.html#common-return-values, the following are the fields unique to this module:

  • request_url - The full url requested returned: always type: str sample: /sys/login/user
  • response_code - The status of api request returned: always type: int sample: 0
  • response_message - The descriptive message of the api response returned: always type: str sample: OK
  • response_data - The data body of the api response returned: optional type: list or dict

Status

  • This module is not guaranteed to have a backwards compatible interface.

Authors

  • Link Zheng (@chillancezen)
  • Jie Xue (@JieX19)
  • Frank Shen (@fshen01)
  • Hongbin Lu (@fgtdev-hblu)

Hint

If you notice any issues in this documentation, you can create a pull request to improve it.