fortinet.fortios.fortios_system_automation_action module – Action for automation stitches in Fortinet’s FortiOS and FortiGate.
Note
This module is part of the fortinet.fortios collection (version 2.1.6).
You might already have this collection installed if you are using the ansible
package.
It is not included in ansible-core
.
To check whether it is installed, run ansible-galaxy collection list
.
To install it, use: ansible-galaxy collection install fortinet.fortios
.
To use it in a playbook, specify: fortinet.fortios.fortios_system_automation_action
.
New in version 2.0.0: of fortinet.fortios
Synopsis
This module is able to configure a FortiGate or FortiOS (FOS) 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 v6.0.0
Requirements
The below requirements are needed on the host that executes this module.
ansible>=2.9.0
Parameters
Parameter |
Comments |
---|---|
Token-based authentication. Generated from GUI of Fortigate. |
|
Enable/Disable logging for task. Choices:
|
|
Member attribute path to operate on. Delimited by a slash character if there are more than one attribute. Parameter marked with member_path is legitimate for doing member operation. |
|
Add or delete a member under specified attribute path. When member_state is specified, the state option is ignored. Choices:
|
|
Indicates whether to create or remove the object. Choices:
|
|
Action for automation stitches. |
|
Access profile for CLI script action to access FortiGate features. Source system.accprofile.name. |
|
Action type. Choices:
|
|
AliCloud AccessKey ID. |
|
AliCloud AccessKey secret. |
|
AliCloud account ID. |
|
AliCloud function name. |
|
AliCloud function authorization type. Choices:
|
|
AliCloud function domain. |
|
AliCloud region. |
|
AliCloud service name. |
|
AliCloud version. |
|
AWS API Gateway ID. |
|
AWS API Gateway API key. |
|
AWS API Gateway path. |
|
AWS API Gateway deployment stage name. |
|
AWS domain. |
|
AWS region. |
|
Azure function API key. |
|
Azure function application name. |
|
Azure function domain. |
|
Azure function name. |
|
Azure function authorization level. Choices:
|
|
Delay before execution (in seconds). |
|
Description. |
|
Email body. |
|
Email sender name. |
|
Email subject. |
|
Email addresses. |
|
Email address. |
|
Enable/disable execution of CLI script on all or only one FortiGate unit in the Security Fabric. Choices:
|
|
Google Cloud function name. |
|
Google Cloud function domain. |
|
Google Cloud function region. |
|
Google Cloud Platform project name. |
|
Request headers. |
|
Request header. |
|
Request body (if necessary). Should be serialized json string. |
|
Message content. |
|
Message type. Choices:
|
|
Request method (POST, PUT, GET, PATCH or DELETE). Choices:
|
|
Limit execution to no more than once in this interval (in seconds). |
|
Name. |
|
Protocol port. |
|
Request protocol. Choices:
|
|
Enable/disable replacement message. Choices:
|
|
Replacement message group. Source system.replacemsg-group.name. |
|
Required in action chain. Choices:
|
|
CLI script. |
|
NSX SDN connector names. |
|
SDN connector name. Source system.sdn-connector.name. |
|
NSX security tag. |
|
Custom TLS certificate for API request. Source certificate.local.name. |
|
Request API URI. |
|
Enable/disable verification of the remote host certificate. Choices:
|
|
Virtual domain, among those defined previously. A vdom is a virtual instance of the FortiGate that can be configured and used as a different unit. Default: “root” |
Examples
- hosts: fortigates
collections:
- fortinet.fortios
connection: httpapi
vars:
vdom: "root"
ansible_httpapi_use_ssl: yes
ansible_httpapi_validate_certs: no
ansible_httpapi_port: 443
tasks:
- name: Action for automation stitches.
fortios_system_automation_action:
vdom: "{{ vdom }}"
state: "present"
access_token: "<your_own_value>"
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"
delay: "25"
description: "<your_own_value>"
email_body: "<your_own_value>"
email_from: "<your_own_value>"
email_subject: "<your_own_value>"
email_to:
-
name: "default_name_31"
execute_security_fabric: "enable"
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>"
message: "<your_own_value>"
message_type: "text"
method: "post"
minimum_interval: "43"
name: "default_name_44"
port: "45"
protocol: "http"
replacement_message: "enable"
replacemsg_group: "<your_own_value> (source system.replacemsg-group.name)"
required: "enable"
script: "<your_own_value>"
sdn_connector:
-
name: "default_name_52 (source system.sdn-connector.name)"
security_tag: "<your_own_value>"
tls_certificate: "<your_own_value> (source certificate.local.name)"
uri: "<your_own_value>"
verify_host_cert: "enable"
Return Values
Common return values are documented here, the following are the fields unique to this module:
Key |
Description |
---|---|
Build number of the fortigate image Returned: always Sample: “1547” |
|
Last method used to provision the content into FortiGate Returned: always Sample: “PUT” |
|
Last result given by FortiGate on last operation applied Returned: always Sample: “200” |
|
Master key (id) used in the last call to FortiGate Returned: success Sample: “id” |
|
Name of the table used to fulfill the request Returned: always Sample: “urlfilter” |
|
Path of the table used to fulfill the request Returned: always Sample: “webfilter” |
|
Internal revision number Returned: always Sample: “17.0.2.10658” |
|
Serial number of the unit Returned: always Sample: “FGVMEVYYQT3AB5352” |
|
Indication of the operation’s result Returned: always Sample: “success” |
|
Virtual domain used Returned: always Sample: “root” |
|
Version of the FortiGate Returned: always Sample: “v5.6.3” |
Authors
Link Zheng (@chillancezen)
Jie Xue (@JieX19)
Hongbin Lu (@fgtdev-hblu)
Frank Shen (@frankshen01)
Miguel Angel Munoz (@mamunozgonzalez)
Nicolas Thomas (@thomnico)