drmofu.fortimanager.fmgr_system_fortiguard (2.2.2) — module

Configure FortiGuard services.

| "added in version" 2.0.0 of drmofu.fortimanager"

Authors: Xinwei Du (@dux-fortinet), Xing Li (@lix-fortinet), Jie Xue (@JieX19), Link Zheng (@chillancezen), Frank Shen (@fshen01), Hongbin Lu (@fgtdev-hblu)

preview | supported by community

Install collection

Install with ansible-galaxy collection install drmofu.fortimanager:==2.2.2


Add to requirements.yml

  collections:
    - name: drmofu.fortimanager
      version: 2.2.2

Description

This module is able to configure a FortiManager device.

Examples include all parameters and values which need to be adjusted to data sources before usage.

Usage examples

  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
 - 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: Configure FortiGuard services.
      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: <value of integer>
            antispam-cache-ttl: <value of integer>
            antispam-expiration: <value of integer>
            antispam-force-off: <value in [disable, enable]>
            antispam-license: <value of integer>
            antispam-timeout: <value of integer>
            auto-join-forticloud: <value in [disable, enable]>
            ddns-server-ip: <value of string>
            ddns-server-port: <value of integer>
            load-balance-servers: <value of integer>
            outbreak-prevention-cache: <value in [disable, enable]>
            outbreak-prevention-cache-mpercent: <value of integer>
            outbreak-prevention-cache-ttl: <value of integer>
            outbreak-prevention-expiration: <value of integer>
            outbreak-prevention-force-off: <value in [disable, enable]>
            outbreak-prevention-license: <value of integer>
            outbreak-prevention-timeout: <value of integer>
            port: <value in [53, 80, 8888, ...]>
            sdns-server-ip: <value of string>
            sdns-server-port: <value of integer>
            service-account-id: <value of string>
            source-ip: <value of string>
            source-ip6: <value of string>
            update-server-location: <value in [any, usa, automatic, ...]>
            webfilter-cache: <value in [disable, enable]>
            webfilter-cache-ttl: <value of integer>
            webfilter-expiration: <value of integer>
            webfilter-force-off: <value in [disable, enable]>
            webfilter-license: <value of integer>
            webfilter-timeout: <value of integer>
            protocol: <value in [udp, http, https]>
            proxy-password: <value of string>
            proxy-server-ip: <value of string>
            proxy-server-port: <value of integer>
            proxy-username: <value of string>
            sandbox-region: <value of string>
            avquery-cache-ttl: <value of integer>
            avquery-timeout: <value of integer>
            avquery-cache: <value in [disable, enable]>
            avquery-cache-mpercent: <value of integer>
            avquery-license: <value of integer>
            avquery-force-off: <value in [disable, enable]>
            fortiguard-anycast: <value in [disable, enable]>
            fortiguard-anycast-source: <value in [fortinet, aws, debug]>
            interface: <value of string>
            interface-select-method: <value in [auto, sdwan, specify]>
            sdns-options:
              - include-question-section
            anycast-sdns-server-ip: <value of string>
            anycast-sdns-server-port: <value of 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: <value of integer>
            videofilter-license: <value of integer>
            ddns-server-ip6: <value of string>
            vdom: <value of string>
            auto-firmware-upgrade: <value in [disable, enable]>
            auto-firmware-upgrade-day:
              - sunday
              - monday
              - tuesday
              - wednesday
              - thursday
              - friday
              - saturday
            auto-firmware-upgrade-end-hour: <value of integer>
            auto-firmware-upgrade-start-hour: <value of integer>
            sandbox-inline-scan: <value in [disable, enable]>
            FDS-license-expiring-days: <value of integer>
            antispam-cache-mpermille: <value of integer>
            auto-firmware-upgrade-delay: <value of integer>
            outbreak-prevention-cache-mpermille: <value of integer>
            update-dldb: <value in [disable, enable]>

Inputs

    
adom:
    description: the parameter (adom) in requested url
    required: true
    type: str

rc_failed:
    description: The rc codes list with which the conditions to fail will be overriden.
    elements: int
    required: false
    type: list

enable_log:
    default: false
    description: Enable/Disable logging for task.
    required: false
    type: bool

access_token:
    description: The token to access FortiManager without using username and password.
    required: false
    type: str

rc_succeeded:
    description: The rc codes list with which the conditions to succeed will be overriden.
    elements: int
    required: false
    type: list

proposed_method:
    choices:
    - update
    - set
    - add
    description: The overridden method for the underlying Json RPC request.
    required: false
    type: str

bypass_validation:
    default: false
    description: Only set to True when module schema diffs with FortiManager API structure,
      module continues to execute without validating parameters.
    required: false
    type: bool

system_fortiguard:
    description: the top level parameters set
    required: false
    suboptions:
      FDS-license-expiring-days:
        description: Threshold for number of days before FortiGuard license expiration
          to generate license expiring event log
        type: int
      antispam-cache:
        choices:
        - disable
        - enable
        description: Enable/disable FortiGuard antispam request caching.
        type: str
      antispam-cache-mpercent:
        description: Maximum percent of FortiGate memory the antispam cache is allowed
          to use
        type: int
      antispam-cache-mpermille:
        description: Maximum permille of FortiGate memory the antispam cache is allowed
          to use
        type: int
      antispam-cache-ttl:
        description: Time-to-live for antispam cache entries in seconds
        type: int
      antispam-expiration:
        description: Antispam-Expiration.
        type: int
      antispam-force-off:
        choices:
        - disable
        - enable
        description: Enable/disable turning off the FortiGuard antispam service.
        type: str
      antispam-license:
        description: Antispam-License.
        type: int
      antispam-timeout:
        description: Antispam query time out
        type: int
      anycast-sdns-server-ip:
        description: IP address of the FortiGuard anycast DNS rating server.
        type: str
      anycast-sdns-server-port:
        description: Port to connect to on the FortiGuard anycast DNS rating server.
        type: int
      auto-firmware-upgrade:
        choices:
        - disable
        - enable
        description: Enable/disable automatic patch-level firmware upgrade from FortiGuard.
        type: str
      auto-firmware-upgrade-day:
        choices:
        - sunday
        - monday
        - tuesday
        - wednesday
        - thursday
        - friday
        - saturday
        description: description
        elements: str
        type: list
      auto-firmware-upgrade-delay:
        description: Delay of day
        type: int
      auto-firmware-upgrade-end-hour:
        description: End time in the designated time window for automatic patch-level
          firmware upgrade from FortiGuard in 24 hour time
        type: int
      auto-firmware-upgrade-start-hour:
        description: Start time in the designated time window for automatic patch-level
          firmware upgrade from FortiGuard in 24 hour time
        type: int
      auto-join-forticloud:
        choices:
        - disable
        - enable
        description: Automatically connect to and login to FortiCloud.
        type: str
      avquery-cache:
        choices:
        - disable
        - enable
        description: Enable/disable the FortiGuard antivirus cache.
        type: str
      avquery-cache-mpercent:
        description: Maximum percent of memory the antivirus cache can use
        type: int
      avquery-cache-ttl:
        description: Time-to-live for antivirus cache entries
        type: int
      avquery-force-off:
        choices:
        - disable
        - enable
        description: Turn off the FortiGuard antivirus service.
        type: str
      avquery-license:
        description: Interval of time between license checks for the FortiGuard antivirus
          contract.
        type: int
      avquery-timeout:
        description: Antivirus query time out
        type: int
      ddns-server-ip:
        description: IP address of the FortiDDNS server.
        type: str
      ddns-server-ip6:
        description: IPv6 address of the FortiDDNS server.
        type: str
      ddns-server-port:
        description: Port used to communicate with FortiDDNS servers.
        type: int
      fortiguard-anycast:
        choices:
        - disable
        - enable
        description: Enable/disable use of FortiGuards anycast network.
        type: str
      fortiguard-anycast-source:
        choices:
        - fortinet
        - aws
        - debug
        description: Configure which of Fortinets servers to provide FortiGuard services
          in FortiGuards anycast network.
        type: str
      interface:
        description: Specify outgoing interface to reach server.
        type: str
      interface-select-method:
        choices:
        - auto
        - sdwan
        - specify
        description: Specify how to select outgoing interface to reach server.
        type: str
      load-balance-servers:
        description: Number of servers to alternate between as first FortiGuard option.
        type: int
      outbreak-prevention-cache:
        choices:
        - disable
        - enable
        description: Enable/disable FortiGuard Virus Outbreak Prevention cache.
        type: str
      outbreak-prevention-cache-mpercent:
        description: Maximum percent of memory FortiGuard Virus Outbreak Prevention cache
          can use
        type: int
      outbreak-prevention-cache-mpermille:
        description: Maximum permille of memory FortiGuard Virus Outbreak Prevention cache
          can use
        type: int
      outbreak-prevention-cache-ttl:
        description: Time-to-live for FortiGuard Virus Outbreak Prevention cache entries
        type: int
      outbreak-prevention-expiration:
        description: Outbreak-Prevention-Expiration.
        type: int
      outbreak-prevention-force-off:
        choices:
        - disable
        - enable
        description: Turn off FortiGuard Virus Outbreak Prevention service.
        type: str
      outbreak-prevention-license:
        description: Outbreak-Prevention-License.
        type: int
      outbreak-prevention-timeout:
        description: FortiGuard Virus Outbreak Prevention time out
        type: int
      persistent-connection:
        choices:
        - disable
        - enable
        description: Enable/disable use of persistent connection to receive update notification
          from FortiGuard.
        type: str
      port:
        choices:
        - '53'
        - '80'
        - '8888'
        - '443'
        description: Port used to communicate with the FortiGuard servers.
        type: str
      protocol:
        choices:
        - udp
        - http
        - https
        description: Protocol used to communicate with the FortiGuard servers.
        type: str
      proxy-password:
        description: Proxy user password.
        type: str
      proxy-server-ip:
        description: IP address of the proxy server.
        type: str
      proxy-server-port:
        description: Port used to communicate with the proxy server.
        type: int
      proxy-username:
        description: Proxy user name.
        type: str
      sandbox-inline-scan:
        choices:
        - disable
        - enable
        description: Enable/disable FortiCloud Sandbox inline-scan.
        type: str
      sandbox-region:
        description: Cloud sandbox region.
        type: str
      sdns-options:
        choices:
        - include-question-section
        description: Customization options for the FortiGuard DNS service.
        elements: str
        type: list
      sdns-server-ip:
        description: IP address of the FortiDNS server.
        type: str
      sdns-server-port:
        description: Port used to communicate with FortiDNS servers.
        type: int
      service-account-id:
        description: Service account ID.
        type: str
      source-ip:
        description: Source IPv4 address used to communicate with FortiGuard.
        type: str
      source-ip6:
        description: Source IPv6 address used to communicate with FortiGuard.
        type: str
      update-build-proxy:
        choices:
        - disable
        - enable
        description: Enable/disable proxy dictionary rebuild.
        type: str
      update-dldb:
        choices:
        - disable
        - enable
        description: Enable/disable DLP signature update.
        type: str
      update-extdb:
        choices:
        - disable
        - enable
        description: Enable/disable external resource update.
        type: str
      update-ffdb:
        choices:
        - disable
        - enable
        description: Enable/disable Internet Service Database update.
        type: str
      update-server-location:
        choices:
        - any
        - usa
        - automatic
        - eu
        description: Signature update server location.
        type: str
      update-uwdb:
        choices:
        - disable
        - enable
        description: Enable/disable allowlist update.
        type: str
      vdom:
        description: FortiGuard Service virtual domain name.
        type: str
      videofilter-expiration:
        description: Videofilter-Expiration.
        type: int
      videofilter-license:
        description: Videofilter-License.
        type: int
      webfilter-cache:
        choices:
        - disable
        - enable
        description: Enable/disable FortiGuard web filter caching.
        type: str
      webfilter-cache-ttl:
        description: Time-to-live for web filter cache entries in seconds
        type: int
      webfilter-expiration:
        description: Webfilter-Expiration.
        type: int
      webfilter-force-off:
        choices:
        - disable
        - enable
        description: Enable/disable turning off the FortiGuard web filtering service.
        type: str
      webfilter-license:
        description: Webfilter-License.
        type: int
      webfilter-timeout:
        description: Web filter query time out
        type: int
    type: dict

workspace_locking_adom:
    description: The adom to lock for FortiManager running in workspace mode, the value
      can be global and others including root.
    required: false
    type: str

forticloud_access_token:
    description: Authenticate Ansible client with forticloud API access token.
    required: false
    type: str

workspace_locking_timeout:
    default: 300
    description: The maximum time in seconds to wait for other user to release the workspace
      lock.
    required: false
    type: int

Outputs

meta:
  contains:
    request_url:
      description: The full url requested.
      returned: always
      sample: /sys/login/user
      type: str
    response_code:
      description: The status of api request.
      returned: always
      sample: 0
      type: int
    response_data:
      description: The api response.
      returned: always
      type: list
    response_message:
      description: The descriptive message of the api response.
      returned: always
      sample: OK.
      type: str
    system_information:
      description: The information of the target system.
      returned: always
      type: dict
  description: The result of the request.
  returned: always
  type: dict
rc:
  description: The status the request.
  returned: always
  sample: 0
  type: int
version_check_warning:
  description: Warning if the parameters used in the playbook are not supported by
    the current FortiManager version.
  returned: complex
  type: list