fortiswitch_system_automation_action – Action for automation stitches in Fortinet’s FortiSwitch

New in version 1.0.0.

Synopsis

  • This module is able to configure a FortiSwitch device by allowing the user to set and modify system feature and automation_action category. Examples include all parameters and values need to be adjusted to datasources before usage. Tested with FOS v7.0.0

Requirements

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

  • ansible>=2.14

FortiSW Version Compatibility


Supported Version Ranges
fortiswitch_system_automation_action v7.2.1 -> latest

Parameters

  • enable_log - Enable/Disable logging for task. type: bool required: false default: False
  • member_path - Member attribute path to operate on. type: str
  • member_state - Add or delete a member under specified attribute path. type: str choices: present, absent
  • state - Indicates whether to create or remove the object. type: str required: true choices: present, absent
  • system_automation_action - Action for automation stitches. type: dict
    • accprofile - Access profile for CLI script action to access FortiSwitch features. type: str
    • action_type - Action type. type: str choices: email, alert, cli-script, snmp-trap, webhook
    • alicloud_access_key_id - AliCloud AccessKey ID. type: str
    • alicloud_access_key_secret - AliCloud AccessKey secret. type: str
    • alicloud_account_id - AliCloud account ID. type: str
    • alicloud_function - AliCloud function name. type: str
    • alicloud_function_authorization - AliCloud function authorization type. type: str choices: anonymous, function
    • alicloud_function_domain - AliCloud function domain. type: str
    • alicloud_region - AliCloud region. type: str
    • alicloud_service - AliCloud service name. type: str
    • alicloud_version - AliCloud version. type: str
    • aws_api_id - AWS API Gateway ID. type: str
    • aws_api_key - AWS API Gateway API key. type: str
    • aws_api_path - AWS API Gateway path. type: str
    • aws_api_stage - AWS API Gateway deployment stage name. type: str
    • aws_domain - AWS domain. type: str
    • aws_region - AWS region. type: str
    • azure_api_key - Azure function API key. type: str
    • azure_app - Azure function application name. type: str
    • azure_domain - Azure function domain. type: str
    • azure_function - Azure function name. type: str
    • azure_function_authorization - Azure function authorization level. type: str choices: anonymous, function, admin
    • email_body - Email body. type: str
    • email_from - Email sender name. type: str
    • email_subject - Email subject. type: str
    • email_to - Email addresses. type: list
      • name - Email address. type: str
    • gcp_function - Google Cloud function name. type: str
    • gcp_function_domain - Google Cloud function domain. type: str
    • gcp_function_region - Google Cloud function region. type: str
    • gcp_project - Google Cloud Platform project name. type: str
    • headers - Request headers. type: list
      • header - Request header. type: str
    • http_body - Request body (if necessary). Should be serialized json string. type: str
    • method - Request method (POST, PUT, GET, PATCH or DELETE). type: str choices: post, put, get, patch, delete
    • minimum_interval - Limit execution to no more than once in this interval (in seconds). type: int
    • name - Name. type: str required: true
    • port - Protocol port. type: int
    • protocol - Request protocol. type: str choices: http, https
    • script - CLI script. type: str
    • snmp_trap - SNMP trap. type: str choices: cpu-high, mem-low, syslog-full, test-trap
    • uri - Request API URI. type: str

Examples

- name: Action for automation stitches.
  fortinet.fortiswitch.fortiswitch_system_automation_action:
      state: "present"
      system_automation_action:
          accprofile: "<your_own_value> (source system.accprofile.name)"
          action_type: "email"
          alicloud_access_key_id: "<your_own_value>"
          alicloud_access_key_secret: "<your_own_value>"
          alicloud_account_id: "<your_own_value>"
          alicloud_function: "<your_own_value>"
          alicloud_function_authorization: "anonymous"
          alicloud_function_domain: "<your_own_value>"
          alicloud_region: "<your_own_value>"
          alicloud_service: "<your_own_value>"
          alicloud_version: "<your_own_value>"
          aws_api_id: "<your_own_value>"
          aws_api_key: "<your_own_value>"
          aws_api_path: "<your_own_value>"
          aws_api_stage: "<your_own_value>"
          aws_domain: "<your_own_value>"
          aws_region: "<your_own_value>"
          azure_api_key: "<your_own_value>"
          azure_app: "<your_own_value>"
          azure_domain: "<your_own_value>"
          azure_function: "<your_own_value>"
          azure_function_authorization: "anonymous"
          email_body: "<your_own_value>"
          email_from: "<your_own_value>"
          email_subject: "<your_own_value>"
          email_to:
              -
                  name: "default_name_29"
          gcp_function: "<your_own_value>"
          gcp_function_domain: "<your_own_value>"
          gcp_function_region: "<your_own_value>"
          gcp_project: "<your_own_value>"
          headers:
              -
                  header: "<your_own_value>"
          http_body: "<your_own_value>"
          method: "post"
          minimum_interval: "38"
          name: "default_name_39"
          port: "40"
          protocol: "http"
          script: "<your_own_value>"
          snmp_trap: "cpu-high"
          uri: "<your_own_value>"

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:

  • build - Build number of the fortiSwitch image returned: always type: str sample: 1547
  • http_method - Last method used to provision the content into FortiSwitch returned: always type: str sample: PUT
  • http_status - Last result given by FortiSwitch on last operation applied returned: always type: str sample: 200
  • mkey - Master key (id) used in the last call to FortiSwitch returned: success type: str sample: id
  • name - Name of the table used to fulfill the request returned: always type: str sample: urlfilter
  • path - Path of the table used to fulfill the request returned: always type: str sample: webfilter
  • serial - Serial number of the unit returned: always type: str sample: FS1D243Z13000122
  • status - Indication of the operation's result returned: always type: str sample: success
  • version - Version of the FortiSwitch returned: always type: str sample: v7.0.0

Status

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

Authors

  • Link Zheng (@chillancezen)

  • Jie Xue (@JieX19)

  • Hongbin Lu (@fgtdev-hblu)

  • Frank Shen (@frankshen01)

  • Miguel Angel Munoz (@mamunozgonzalez)

Hint

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