fortinet.fortimanager.fmgr_spamfilter_profile – Configure AntiSpam profiles.

Note

This plugin is part of the fortinet.fortimanager collection (version 1.0.5).

To install it use: ansible-galaxy collection install fortinet.fortimanager.

To use it in a playbook, specify: fortinet.fortimanager.fmgr_spamfilter_profile.

New in version 2.10: of fortinet.fortimanager

Synopsis

  • This module is able to configure a FortiManager device by allowing the user to [ add get set update ] the following apis.

  • /pm/config/adom/{adom}/obj/spamfilter/profile

  • /pm/config/global/obj/spamfilter/profile

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

Parameters

Parameter Choices/Defaults Comments
loose_validation
boolean
    Choices:
  • no
  • yes
Do parameter validation in a loose way
method
string / required
    Choices:
  • add
  • get
  • set
  • update
The method in request
params
list / elements=string
The parameters for each method
See full parameters list in https://ansible-galaxy-fortimanager-docs.readthedocs.io/en/latest
url_params
dictionary
The parameters for each API request URL
Also see full URL parameters in https://ansible-galaxy-fortimanager-docs.readthedocs.io/en/latest
workspace_locking_adom
string
the adom name to lock in case FortiManager running in workspace mode
it can be global or any other custom adom names
workspace_locking_timeout
integer
Default:
300
the maximum time in seconds to wait for other user to release the workspace lock

Notes

Note

  • There are only three top-level parameters where ‘method’ is always required while other two ‘params’ and ‘url_params’ can be optional

  • Due to the complexity of fortimanager api schema, the validation is done out of Ansible native parameter validation procedure.

  • The syntax of OPTIONS doen not comply with the standard Ansible argument specification, but with the structure of fortimanager API schema, we need a trivial transformation when we are filling the ansible playbook

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: REQUESTING /PM/CONFIG/OBJ/SPAMFILTER/PROFILE
     fmgr_spamfilter_profile:
        loose_validation: False
        workspace_locking_adom: <value in [global, custom adom]>
        workspace_locking_timeout: 300
        method: <value in [add, set, update]>
        url_params:
           adom: <value in [none, global, custom dom]>
        params:
           -
              data:
                -
                    comment: <value of string>
                    external: <value in [disable, enable]>
                    flow-based: <value in [disable, enable]>
                    name: <value of string>
                    options:
                      - <value in [bannedword, spamemailbwl, spamfsip, ...]>
                    replacemsg-group: <value of string>
                    spam-bwl-table: <value of string>
                    spam-bword-table: <value of string>
                    spam-bword-threshold: <value of integer>
                    spam-filtering: <value in [disable, enable]>
                    spam-iptrust-table: <value of string>
                    spam-log: <value in [disable, enable]>
                    spam-log-fortiguard-response: <value in [disable, enable]>
                    spam-mheader-table: <value of string>
                    spam-rbl-table: <value of string>

   - name: REQUESTING /PM/CONFIG/OBJ/SPAMFILTER/PROFILE
     fmgr_spamfilter_profile:
        loose_validation: False
        workspace_locking_adom: <value in [global, custom adom]>
        workspace_locking_timeout: 300
        method: <value in [get]>
        url_params:
           adom: <value in [none, global, custom dom]>
        params:
           -
              attr: <value of string>
              fields:
                -
                   - <value in [comment, external, flow-based, ...]>
              filter:
                - <value of string>
              get used: <value of integer>
              loadsub: <value of integer>
              option: <value in [count, object member, datasrc, ...]>
              range:
                - <value of integer>
              sortings:
                -
                    varidic.attr_name: <value in [1, -1]>

Return Values

Common return values are documented here, the following are the fields unique to this module:

Key Returned Description
data
dictionary
always
The payload returned in the request

status
dictionary
always
The status of api request

url
string
always
The full url requested

Sample:
/sys/login/user


Authors

  • Frank Shen (@fshen01)

  • Link Zheng (@zhengl)