fmgr_system_fortiguard – Configure FortiGuard services.

Added in version 2.0.0.

Warning

Starting in version 3.0.0, all input arguments will be named using the underscore naming convention (snake_case).

  • Argument name before 3.0.0: var-name, var name, var.name

  • New argument name starting in 3.0.0: var_name

FortiManager Ansible v2.4+ supports both previous argument name and new underscore name. You will receive deprecation warnings if you keep using the previous argument name. You can ignore the warning by setting deprecation_warnings=False in ansible.cfg.

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.x and v7.x.

Requirements

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

  • ansible>=2.15.0

FortiManager Version Compatibility

Supported Version Ranges: v6.0.0 -> latest

Parameters

  • access_token -The token to access FortiManager without using username and password. type: str required: false
  • 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
  • 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
  • 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
  • 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
  • adom - The parameter in requested url type: str required: true
  • system_fortiguard - Configure FortiGuard services. type: dict
    • antispam_cache (Alias name: antispam-cache) Enable/disable fortiguard antispam request caching. type: str choices: [disable, enable] more...
    • antispam_cache_mpercent (Alias name: antispam-cache-mpercent) Maximum percent of fortigate memory the antispam cache is allowed to use (1 - 15%). type: int more...
    • antispam_cache_ttl (Alias name: antispam-cache-ttl) Time-to-live for antispam cache entries in seconds (300 - 86400). type: int more...
    • antispam_expiration (Alias name: antispam-expiration) Antispam-expiration. type: int more...
    • antispam_force_off (Alias name: antispam-force-off) Enable/disable turning off the fortiguard antispam service. type: str choices: [disable, enable] more...
    • antispam_license (Alias name: antispam-license) Antispam-license. type: int more...
    • antispam_timeout (Alias name: antispam-timeout) Antispam query time out (1 - 30 sec, default = 7). type: int more...
    • auto_join_forticloud (Alias name: auto-join-forticloud) Automatically connect to and login to forticloud. type: str choices: [disable, enable] more...
    • ddns_server_ip (Alias name: ddns-server-ip) Ip address of the fortiddns server. type: str more...
    • ddns_server_port (Alias name: ddns-server-port) Port used to communicate with fortiddns servers. type: int more...
    • load_balance_servers (Alias name: load-balance-servers) Number of servers to alternate between as first fortiguard option. type: int more...
    • outbreak_prevention_cache (Alias name: outbreak-prevention-cache) Enable/disable fortiguard virus outbreak prevention cache. type: str choices: [disable, enable] more...
    • outbreak_prevention_cache_mpercent (Alias name: outbreak-prevention-cache-mpercent) Maximum percent of memory fortiguard virus outbreak prevention cache can use (1 - 15%, default = 2). type: int more...
    • outbreak_prevention_cache_ttl (Alias name: outbreak-prevention-cache-ttl) Time-to-live for fortiguard virus outbreak prevention cache entries (300 - 86400 sec, default = 300). type: int more...
    • outbreak_prevention_expiration (Alias name: outbreak-prevention-expiration) Outbreak-prevention-expiration. type: int more...
    • outbreak_prevention_force_off (Alias name: outbreak-prevention-force-off) Turn off fortiguard virus outbreak prevention service. type: str choices: [disable, enable] more...
    • outbreak_prevention_license (Alias name: outbreak-prevention-license) Outbreak-prevention-license. type: int more...
    • outbreak_prevention_timeout (Alias name: outbreak-prevention-timeout) Fortiguard virus outbreak prevention time out (1 - 30 sec, default = 7). type: int more...
    • port Port used to communicate with the fortiguard servers. type: str choices: [53, 80, 8888, 443] more...
    • sdns_server_ip (Alias name: sdns-server-ip) Ip address of the fortidns server. type: list more...
    • sdns_server_port (Alias name: sdns-server-port) Port used to communicate with fortidns servers. type: int more...
    • service_account_id (Alias name: service-account-id) Service account id. type: str more...
    • source_ip (Alias name: source-ip) Source ipv4 address used to communicate with fortiguard. type: str more...
    • source_ip6 (Alias name: source-ip6) Source ipv6 address used to communicate with fortiguard. type: str more...
    • update_server_location (Alias name: update-server-location) Signature update server location. type: str choices: [any, usa, automatic, eu] more...
    • webfilter_cache (Alias name: webfilter-cache) Enable/disable fortiguard web filter caching. type: str choices: [disable, enable] more...
    • webfilter_cache_ttl (Alias name: webfilter-cache-ttl) Time-to-live for web filter cache entries in seconds (300 - 86400). type: int more...
    • webfilter_expiration (Alias name: webfilter-expiration) Webfilter-expiration. type: int more...
    • webfilter_force_off (Alias name: webfilter-force-off) Enable/disable turning off the fortiguard web filtering service. type: str choices: [disable, enable] more...
    • webfilter_license (Alias name: webfilter-license) Webfilter-license. type: int more...
    • webfilter_timeout (Alias name: webfilter-timeout) Web filter query time out (1 - 30 sec, default = 7). type: int more...
    • protocol Protocol used to communicate with the fortiguard servers. type: str choices: [udp, http, https] more...
    • proxy_password (Alias name: proxy-password) Proxy user password. type: list more...
    • proxy_server_ip (Alias name: proxy-server-ip) Ip address of the proxy server. type: str more...
    • proxy_server_port (Alias name: proxy-server-port) Port used to communicate with the proxy server. type: int more...
    • proxy_username (Alias name: proxy-username) Proxy user name. type: str more...
    • sandbox_region (Alias name: sandbox-region) Cloud sandbox region. type: str more...
    • avquery_cache_ttl (Alias name: avquery-cache-ttl) Time-to-live for antivirus cache entries (300 - 86400 sec, default = 1800). type: int more...
    • avquery_timeout (Alias name: avquery-timeout) Antivirus query time out (1 - 30 sec, default = 7). type: int more...
    • avquery_cache (Alias name: avquery-cache) Enable/disable the fortiguard antivirus cache. type: str choices: [disable, enable] more...
    • avquery_cache_mpercent (Alias name: avquery-cache-mpercent) Maximum percent of memory the antivirus cache can use (1 - 15%, default = 2). type: int more...
    • avquery_license (Alias name: avquery-license) Interval of time between license checks for the fortiguard antivirus contract. type: int more...
    • avquery_force_off (Alias name: avquery-force-off) Turn off the fortiguard antivirus service. type: str choices: [disable, enable] more...
    • fortiguard_anycast (Alias name: fortiguard-anycast) Enable/disable use of fortiguards anycast network. type: str choices: [disable, enable] more...
    • fortiguard_anycast_source (Alias name: fortiguard-anycast-source) Configure which of fortinets servers to provide fortiguard services in fortiguards anycast network. type: str choices: [fortinet, aws, debug] more...
    • interface Specify outgoing interface to reach server. type: str more...
    • interface_select_method (Alias name: interface-select-method) Specify how to select outgoing interface to reach server. type: str choices: [auto, sdwan, specify] more...
    • sdns_options (Alias name: sdns-options) Customization options for the fortiguard dns service. type: list choices: [include-question-section] more...
    • anycast_sdns_server_ip (Alias name: anycast-sdns-server-ip) Ip address of the fortiguard anycast dns rating server. type: str more...
    • anycast_sdns_server_port (Alias name: anycast-sdns-server-port) Port to connect to on the fortiguard anycast dns rating server. type: int more...
    • persistent_connection (Alias name: persistent-connection) Enable/disable use of persistent connection to receive update notification from fortiguard. type: str choices: [disable, enable] more...
    • update_build_proxy (Alias name: update-build-proxy) Enable/disable proxy dictionary rebuild. type: str choices: [disable, enable] more...
    • update_extdb (Alias name: update-extdb) Enable/disable external resource update. type: str choices: [disable, enable] more...
    • update_ffdb (Alias name: update-ffdb) Enable/disable internet service database update. type: str choices: [disable, enable] more...
    • update_uwdb (Alias name: update-uwdb) Enable/disable allowlist update. type: str choices: [disable, enable] more...
    • videofilter_expiration (Alias name: videofilter-expiration) Videofilter-expiration. type: int more...
    • videofilter_license (Alias name: videofilter-license) Videofilter-license. type: int more...
    • ddns_server_ip6 (Alias name: ddns-server-ip6) Ipv6 address of the fortiddns server. type: str more...
    • vdom Fortiguard service virtual domain name. type: str more...
    • auto_firmware_upgrade (Alias name: auto-firmware-upgrade) Enable/disable automatic patch-level firmware upgrade from fortiguard. type: str choices: [disable, enable] more...
    • auto_firmware_upgrade_day (Alias name: auto-firmware-upgrade-day) type: list choices: [sunday, monday, tuesday, wednesday, thursday, friday, saturday] more...
    • auto_firmware_upgrade_end_hour (Alias name: auto-firmware-upgrade-end-hour) End time in the designated time window for automatic patch-level firmware upgrade from fortiguard in 24 hour time (0 ~ 23, default = 4). type: int more...
    • auto_firmware_upgrade_start_hour (Alias name: auto-firmware-upgrade-start-hour) Start time in the designated time window for automatic patch-level firmware upgrade from fortiguard in 24 hour time (0 ~ 23, default = 2). type: int more...
    • sandbox_inline_scan (Alias name: sandbox-inline-scan) Enable/disable forticloud sandbox inline-scan. type: str choices: [disable, enable] more...
    • auto_firmware_upgrade_delay (Alias name: auto-firmware-upgrade-delay) Delay of day(s) before installing an automatic patch-level firmware upgrade from fortiguard (default = 3). type: int more...
    • gui_prompt_auto_upgrade (Alias name: gui-prompt-auto-upgrade) Enable/disable prompting of automatic patch-level firmware upgrade recommendation. type: str choices: [disable, enable] more...
    • FDS_license_expiring_days (Alias name: FDS-license-expiring-days) Threshold for number of days before fortiguard license expiration to generate license expiring event log (1 - 100 days, default = 15). type: int more...
    • antispam_cache_mpermille (Alias name: antispam-cache-mpermille) Maximum permille of fortigate memory the antispam cache is allowed to use (1 - 150). type: int more...
    • outbreak_prevention_cache_mpermille (Alias name: outbreak-prevention-cache-mpermille) Maximum permille of memory fortiguard virus outbreak prevention cache can use (1 - 150 permille, default = 1). type: int more...
    • update_dldb (Alias name: update-dldb) Enable/disable dlp signature update. type: str choices: [disable, enable] 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

- 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 services.
      fortinet.fortimanager.fmgr_system_fortiguard:
        # 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, ...]
        adom: <your own value>
        system_fortiguard:
          antispam_cache: <value in [disable, enable]>
          antispam_cache_mpercent: <integer>
          antispam_cache_ttl: <integer>
          antispam_expiration: <integer>
          antispam_force_off: <value in [disable, enable]>
          antispam_license: <integer>
          antispam_timeout: <integer>
          auto_join_forticloud: <value in [disable, enable]>
          ddns_server_ip: <string>
          ddns_server_port: <integer>
          load_balance_servers: <integer>
          outbreak_prevention_cache: <value in [disable, enable]>
          outbreak_prevention_cache_mpercent: <integer>
          outbreak_prevention_cache_ttl: <integer>
          outbreak_prevention_expiration: <integer>
          outbreak_prevention_force_off: <value in [disable, enable]>
          outbreak_prevention_license: <integer>
          outbreak_prevention_timeout: <integer>
          port: <value in [53, 80, 8888, ...]>
          sdns_server_ip: <list or string>
          sdns_server_port: <integer>
          service_account_id: <string>
          source_ip: <string>
          source_ip6: <string>
          update_server_location: <value in [any, usa, automatic, ...]>
          webfilter_cache: <value in [disable, enable]>
          webfilter_cache_ttl: <integer>
          webfilter_expiration: <integer>
          webfilter_force_off: <value in [disable, enable]>
          webfilter_license: <integer>
          webfilter_timeout: <integer>
          protocol: <value in [udp, http, https]>
          proxy_password: <list or string>
          proxy_server_ip: <string>
          proxy_server_port: <integer>
          proxy_username: <string>
          sandbox_region: <string>
          avquery_cache_ttl: <integer>
          avquery_timeout: <integer>
          avquery_cache: <value in [disable, enable]>
          avquery_cache_mpercent: <integer>
          avquery_license: <integer>
          avquery_force_off: <value in [disable, enable]>
          fortiguard_anycast: <value in [disable, enable]>
          fortiguard_anycast_source: <value in [fortinet, aws, debug]>
          interface: <string>
          interface_select_method: <value in [auto, sdwan, specify]>
          sdns_options:
            - include-question-section
          anycast_sdns_server_ip: <string>
          anycast_sdns_server_port: <integer>
          persistent_connection: <value in [disable, enable]>
          update_build_proxy: <value in [disable, enable]>
          update_extdb: <value in [disable, enable]>
          update_ffdb: <value in [disable, enable]>
          update_uwdb: <value in [disable, enable]>
          videofilter_expiration: <integer>
          videofilter_license: <integer>
          ddns_server_ip6: <string>
          vdom: <string>
          auto_firmware_upgrade: <value in [disable, enable]>
          auto_firmware_upgrade_day:
            - sunday
            - monday
            - tuesday
            - wednesday
            - thursday
            - friday
            - saturday
          auto_firmware_upgrade_end_hour: <integer>
          auto_firmware_upgrade_start_hour: <integer>
          sandbox_inline_scan: <value in [disable, enable]>
          auto_firmware_upgrade_delay: <integer>
          gui_prompt_auto_upgrade: <value in [disable, enable]>
          FDS_license_expiring_days: <integer>
          antispam_cache_mpermille: <integer>
          outbreak_prevention_cache_mpermille: <integer>
          update_dldb: <value in [disable, enable]>

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:

  • meta - The result of the request.returned: always type: dict
    • 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_data - The data body of the api response. returned: optional type: list or dict
    • response_message - The descriptive message of the api response. returned: always type: str sample: OK
    • system_information - The information of the target system. returned: always type: dict
  • rc - The status the request. returned: always type: int sample: 0
  • version_check_warning - Warning if the parameters used in the playbook are not supported by the current FortiManager version. returned: if at least one parameter not supported by the current FortiManager version type: list

Status

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

Authors

  • Xinwei Du (@dux-fortinet)

  • Xing Li (@lix-fortinet)

  • Jie Xue (@JieX19)

  • Link Zheng (@chillancezen)

  • Frank Shen (@fshen01)

  • Hongbin Lu (@fgtdev-hblu)