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.
  • Tested with FortiManager v6.0.0.

Requirements

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

  • ansible>=2.9.0

Parameters

  • 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 - SQL settings. type: dict
    • background-rebuild - Disable/Enable rebuild SQL database in the background. type: str choices: [disable, enable] default: enable
    • custom-index - No description for the parameter type: array
      • case-sensitive - Disable/Enable case sensitive index. type: str choices: [disable, enable] default: disable
      • device-type - Device type. type: str choices: [FortiGate, FortiManager, FortiClient, FortiMail, FortiWeb, FortiCache, FortiSandbox, FortiDDoS, FortiAuthenticator, FortiProxy] default: FortiGate
      • id - Add or Edit log index fields. type: int default: 0
      • index-field - Log field name to be indexed. type: str
      • 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] default: traffic
    • database-name - Database name. type: str
    • database-type - Database type. type: str choices: [mysql, postgres] default: postgres
    • device-count-high - Must set to enable if the count of registered devices is greater than 8000. type: str choices: [disable, enable] default: disable
    • event-table-partition-time - Maximum SQL database table partitioning time range in minute (0 for unlimited) for event logs. type: int default: 0
    • fct-table-partition-time - Maximum SQL database table partitioning time range in minute (0 for unlimited) for FortiClient logs. type: int default: 240
    • logtype - No description for the parameter 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]
    • password - No description for the parameter type: str
    • prompt-sql-upgrade - Prompt to convert log database into SQL database at start time on GUI. type: str choices: [disable, enable] default: enable
    • rebuild-event - Disable/Enable rebuild event during SQL database rebuilding. type: str choices: [disable, enable] default: enable
    • rebuild-event-start-time - No description for the parameter type: str
    • server - Database IP or hostname. type: str
    • start-time - No description for the parameter type: str
    • status - SQL database status. type: str choices: [disable, local] default: local
    • text-search-index - Disable/Enable text search index. type: str choices: [disable, enable] default: disable
    • traffic-table-partition-time - Maximum SQL database table partitioning time range in minute (0 for unlimited) for traffic logs. type: int default: 0
    • ts-index-field - No description for the parameter type: array
      • category - Category of text search index fields. type: str
      • value - Fields of text search index. type: str
    • username - User name for login remote database. type: str
    • utm-table-partition-time - Maximum SQL database table partitioning time range in minute (0 for unlimited) for UTM logs. type: int default: 0

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: SQL settings.
     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
           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>

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.