lix_fortinet.fortios.fortios_system_automation_action (102.2.120) — module

Action for automation stitches in Fortinet's FortiOS and FortiGate.

| "added in version" 2.0.0 of lix_fortinet.fortios"

Authors: Link Zheng (@chillancezen), Jie Xue (@JieX19), Hongbin Lu (@fgtdev-hblu), Frank Shen (@frankshen01), Miguel Angel Munoz (@mamunozgonzalez), Nicolas Thomas (@thomnico)

preview | supported by community

Install collection

Install with ansible-galaxy collection install lix_fortinet.fortios:==102.2.120


Add to requirements.yml

  collections:
    - name: lix_fortinet.fortios
      version: 102.2.120

Description

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

Usage examples

  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- 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: "0"
        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"
        fos_message: "<your_own_value>"
        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>"
        http_headers:
         -
            id:  "42"
            key: "<your_own_value>"
            value: "<your_own_value>"
        message_type: "text"
        method: "post"
        minimum_interval: "0"
        name: "default_name_48"
        output_size: "10"
        port: "0"
        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_57 (source system.sdn-connector.name)"
        security_tag: "<your_own_value>"
        system_action: "reboot"
        timeout: "0"
        tls_certificate: "<your_own_value> (source certificate.local.name)"
        uri: "<your_own_value>"
        verify_host_cert: "enable"

Inputs

    
vdom:
    default: root
    description:
    - 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.
    type: str

state:
    choices:
    - present
    - absent
    description:
    - Indicates whether to create or remove the object.
    required: true
    type: str

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

member_path:
    description:
    - 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.
    type: str

access_token:
    description:
    - Token-based authentication. Generated from GUI of Fortigate.
    required: false
    type: str

member_state:
    choices:
    - present
    - absent
    description:
    - Add or delete a member under specified attribute path.
    - When member_state is specified, the state option is ignored.
    type: str

system_automation_action:
    default: null
    description:
    - Action for automation stitches.
    suboptions:
      accprofile:
        description:
        - Access profile for CLI script action to access FortiGate features. Source system.accprofile.name.
        type: str
      action_type:
        choices:
        - email
        - fortiexplorer-notification
        - alert
        - disable-ssid
        - system-actions
        - quarantine
        - quarantine-forticlient
        - quarantine-nsx
        - quarantine-fortinac
        - ban-ip
        - aws-lambda
        - azure-function
        - google-cloud-function
        - alicloud-function
        - webhook
        - cli-script
        - slack-notification
        - microsoft-teams-notification
        - ios-notification
        description:
        - Action type.
        type: str
      alicloud_access_key_id:
        description:
        - AliCloud AccessKey ID.
        type: str
      alicloud_access_key_secret:
        description:
        - AliCloud AccessKey secret.
        type: str
      alicloud_account_id:
        description:
        - AliCloud account ID.
        type: str
      alicloud_function:
        description:
        - AliCloud function name.
        type: str
      alicloud_function_authorization:
        choices:
        - anonymous
        - function
        description:
        - AliCloud function authorization type.
        type: str
      alicloud_function_domain:
        description:
        - AliCloud function domain.
        type: str
      alicloud_region:
        description:
        - AliCloud region.
        type: str
      alicloud_service:
        description:
        - AliCloud service name.
        type: str
      alicloud_version:
        description:
        - AliCloud version.
        type: str
      aws_api_id:
        description:
        - AWS API Gateway ID.
        type: str
      aws_api_key:
        description:
        - AWS API Gateway API key.
        type: str
      aws_api_path:
        description:
        - AWS API Gateway path.
        type: str
      aws_api_stage:
        description:
        - AWS API Gateway deployment stage name.
        type: str
      aws_domain:
        description:
        - AWS domain.
        type: str
      aws_region:
        description:
        - AWS region.
        type: str
      azure_api_key:
        description:
        - Azure function API key.
        type: str
      azure_app:
        description:
        - Azure function application name.
        type: str
      azure_domain:
        description:
        - Azure function domain.
        type: str
      azure_function:
        description:
        - Azure function name.
        type: str
      azure_function_authorization:
        choices:
        - anonymous
        - function
        - admin
        description:
        - Azure function authorization level.
        type: str
      delay:
        description:
        - Delay before execution (in seconds).
        type: int
      description:
        description:
        - Description.
        type: str
      email_body:
        description:
        - Email body.
        type: str
      email_from:
        description:
        - Email sender name.
        type: str
      email_subject:
        description:
        - Email subject.
        type: str
      email_to:
        description:
        - Email addresses.
        elements: dict
        suboptions:
          name:
            description:
            - Email address.
            type: str
        type: list
      execute_security_fabric:
        choices:
        - enable
        - disable
        description:
        - Enable/disable execution of CLI script on all or only one FortiGate unit in
          the Security Fabric.
        type: str
      fos_message:
        description:
        - Message content.
        type: str
      gcp_function:
        description:
        - Google Cloud function name.
        type: str
      gcp_function_domain:
        description:
        - Google Cloud function domain.
        type: str
      gcp_function_region:
        description:
        - Google Cloud function region.
        type: str
      gcp_project:
        description:
        - Google Cloud Platform project name.
        type: str
      headers:
        description:
        - Request headers.
        elements: dict
        suboptions:
          header:
            description:
            - Request header.
            type: str
        type: list
      http_body:
        description:
        - Request body (if necessary). Should be serialized json string.
        type: str
      http_headers:
        description:
        - Request headers.
        elements: dict
        suboptions:
          id:
            description:
            - Entry ID.
            type: int
          key:
            description:
            - Request header key.
            type: str
          value:
            description:
            - Request header value.
            type: str
        type: list
      message_type:
        choices:
        - text
        - json
        description:
        - Message type.
        type: str
      method:
        choices:
        - post
        - put
        - get
        - patch
        - delete
        description:
        - Request method (POST, PUT, GET, PATCH or DELETE).
        type: str
      minimum_interval:
        description:
        - Limit execution to no more than once in this interval (in seconds).
        type: int
      name:
        description:
        - Name.
        required: true
        type: str
      output_size:
        description:
        - Number of megabytes to limit script output to (1 - 1024).
        type: int
      port:
        description:
        - Protocol port.
        type: int
      protocol:
        choices:
        - http
        - https
        description:
        - Request protocol.
        type: str
      replacement_message:
        choices:
        - enable
        - disable
        description:
        - Enable/disable replacement message.
        type: str
      replacemsg_group:
        description:
        - Replacement message group. Source system.replacemsg-group.name.
        type: str
      required:
        choices:
        - enable
        - disable
        description:
        - Required in action chain.
        type: str
      script:
        description:
        - CLI script.
        type: str
      sdn_connector:
        description:
        - NSX SDN connector names.
        elements: dict
        suboptions:
          name:
            description:
            - SDN connector name. Source system.sdn-connector.name.
            type: str
        type: list
      security_tag:
        description:
        - NSX security tag.
        type: str
      system_action:
        choices:
        - reboot
        - shutdown
        - backup-config
        description:
        - System action type.
        type: str
      timeout:
        description:
        - Maximum running time for this script in seconds (0 = no timeout).
        type: int
      tls_certificate:
        description:
        - Custom TLS certificate for API request. Source certificate.local.name.
        type: str
      uri:
        description:
        - Request API URI.
        type: str
      verify_host_cert:
        choices:
        - enable
        - disable
        description:
        - Enable/disable verification of the remote host certificate.
        type: str
    type: dict

Outputs

build:
  description: Build number of the fortigate image
  returned: always
  sample: '1547'
  type: str
http_method:
  description: Last method used to provision the content into FortiGate
  returned: always
  sample: PUT
  type: str
http_status:
  description: Last result given by FortiGate on last operation applied
  returned: always
  sample: '200'
  type: str
mkey:
  description: Master key (id) used in the last call to FortiGate
  returned: success
  sample: id
  type: str
name:
  description: Name of the table used to fulfill the request
  returned: always
  sample: urlfilter
  type: str
path:
  description: Path of the table used to fulfill the request
  returned: always
  sample: webfilter
  type: str
revision:
  description: Internal revision number
  returned: always
  sample: 17.0.2.10658
  type: str
serial:
  description: Serial number of the unit
  returned: always
  sample: FGVMEVYYQT3AB5352
  type: str
status:
  description: Indication of the operation's result
  returned: always
  sample: success
  type: str
vdom:
  description: Virtual domain used
  returned: always
  sample: root
  type: str
version:
  description: Version of the FortiGate
  returned: always
  sample: v5.6.3
  type: str