fmgd_system_sdnconnector – Configure connection to SDN Connector.

Added in version 1.1.0.

Synopsis

  • This module is able to configure a FortiManager device.

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

  • Tested with FortiManager v7.x.

Requirements

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

  • ansible-core>=2.16.0

FortiManager Version Compatibility

Supported Version Ranges: v7.4.8 -> v7.4.10, v7.6.4 -> latest

Parameters

  • access_token -The token to access FortiManager without using username and password. type: str required: false
  • bypass_validation - Only set to True when module schema diffs with FortiManager API structure, module continues to execute without validating parameters. type: bool required: false default: False
  • enable_log - Enable/Disable logging for task. type: bool required: false default: False
  • forticloud_access_token - Access token of forticloud managed API users, this option is available with FortiManager later than 6.4.0. type: str required: false
  • proposed_method - The overridden method for the underlying Json RPC request. type: str required: false choices: set, update, add
  • rc_succeeded - The rc codes list with which the conditions to succeed will be overriden. type: list required: false
  • rc_failed - The rc codes list with which the conditions to fail will be overriden. type: list required: false
  • state - The directive to create, update or delete an object type: str required: true choices: present, absent
  • workspace_locking_adom - Acquire the workspace lock if FortiManager is running in workspace mode. type: str required: false choices: global, custom adom including root
  • workspace_locking_timeout - The maximum time in seconds to wait for other users to release workspace lock. type: integer required: false default: 300
  • device - The parameter in requested url type: str required: true
  • system_sdnconnector - Configure connection to SDN Connector. type: dict
    • _local_cert Local cert. type: str more...
    • access_key (Alias name: access-key) Aws / acs access key id. type: str more...
    • alt_resource_ip (Alias name: alt-resource-ip) Enable/disable aws alternative resource ip. type: str choices: [disable, enable] more...
    • api_key (Alias name: api-key) Ibm cloud api key or service id api key. type: list more...
    • azure_region (Alias name: azure-region) Azure server region. type: str choices: [global, china, germany, usgov, local] more...
    • client_id (Alias name: client-id) Azure client id (application id). type: str more...
    • client_secret (Alias name: client-secret) Azure client secret (application key). type: list more...
    • compartment_id (Alias name: compartment-id) Compartment id. type: str more...
    • compute_generation (Alias name: compute-generation) Compute generation for ibm cloud infrastructure. type: int more...
    • domain Domain name. type: str more...
    • external_account_list (Alias name: external-account-list) External account list. type: list more...
      • external_id (Alias name: external-id) Aws external id. type: str more...
      • region_list (Alias name: region-list) Aws region name list. type: list more...
      • role_arn (Alias name: role-arn) Aws role arn to assume. type: str more...
    • external_ip (Alias name: external-ip) External ip. type: list more...
      • name External ip name. type: str more...
    • forwarding_rule (Alias name: forwarding-rule) Forwarding rule. type: list more...
      • rule_name (Alias name: rule-name) Forwarding rule name. type: str more...
      • target Target instance name. type: str more...
    • gcp_project_list (Alias name: gcp-project-list) Gcp project list. type: list more...
      • gcp_zone_list (Alias name: gcp-zone-list) Configure gcp zone list. type: list more...
      • id Gcp project id. type: str more...
    • group_name (Alias name: group-name) Full path group name of computers. type: str more...
    • ha_status (Alias name: ha-status) Enable/disable use for fortigate ha service. type: str choices: [disable, enable] more...
    • ibm_region (Alias name: ibm-region) Ibm cloud region name. type: str choices: [dallas, washington-dc, london, frankfurt, sydney, tokyo, osaka, toronto, sao-paulo, toronto-private, washington-dc-private, london-private, sao-paulo-private, dallas-private, frankfurt-private, sydney-private, tokyo-private, osaka-private, japan, germany, us-south, great-britain, australia, us-east, madrid-private, madrid] more...
    • key_passwd (Alias name: key-passwd) Private key password. type: list more...
    • login_endpoint (Alias name: login-endpoint) Azure stack login endpoint. type: str more...
    • name Sdn connector name. type: str more...
    • nic Nic. type: list more...
      • ip Ip. type: list more...
        • name Ip configuration name. type: str more...
        • public_ip (Alias name: public-ip) Public ip name. type: str more...
        • resource_group (Alias name: resource-group) Resource group of azure public ip. type: str more...
        • private_ip (Alias name: private-ip) Private ip address. type: str more...
      • name Network interface name. type: str more...
      • peer_nic (Alias name: peer-nic) Peer network interface name. type: str more...
    • oci_cert (Alias name: oci-cert) Oci certificate. type: list more...
    • oci_fingerprint (Alias name: oci-fingerprint) Oci fingerprint. type: str more...
    • oci_region (Alias name: oci-region) Oci server region. type: str more...
    • oci_region_type (Alias name: oci-region-type) Oci region type. type: str choices: [commercial, government] more...
    • password Password of the remote sdn connector as login credentials. type: list more...
    • private_key (Alias name: private-key) Private key of gcp service account. type: str more...
    • region Aws / acs region name. type: str more...
    • resource_group (Alias name: resource-group) Azure resource group. type: str more...
    • resource_url (Alias name: resource-url) Azure stack resource url. type: str more...
    • route Route. type: list more...
      • name Route name. type: str more...
    • route_table (Alias name: route-table) Route table. type: list more...
      • name Route table name. type: str more...
      • resource_group (Alias name: resource-group) Resource group of azure route table. type: str more...
      • route Route. type: list more...
        • name Route name. type: str more...
        • next_hop (Alias name: next-hop) Next hop address. type: str more...
      • subscription_id (Alias name: subscription-id) Subscription id of azure route table. type: str more...
    • secret_key (Alias name: secret-key) Aws / acs secret access key. type: list more...
    • secret_token (Alias name: secret-token) Secret token of kubernetes service account. type: str more...
    • server Server address of the remote sdn connector. type: str more...
    • server_ca_cert (Alias name: server-ca-cert) Trust only those servers whose certificate is directly/indirectly signed by this certificate. type: list more...
    • server_cert (Alias name: server-cert) Trust servers that contain this certificate only. type: list more...
    • server_list (Alias name: server-list) Server address list of the remote sdn connector. type: list more...
    • server_port (Alias name: server-port) Port number of the remote sdn connector. type: int more...
    • service_account (Alias name: service-account) Gcp service account email. type: str more...
    • status Enable/disable connection to the remote sdn connector. type: str choices: [disable, enable] more...
    • subscription_id (Alias name: subscription-id) Azure subscription id. type: str more...
    • tenant_id (Alias name: tenant-id) Tenant id (directory id). type: str more...
    • type Type of sdn connector. type: str choices: [aci, aws, nsx, nuage, azure, gcp, oci, openstack, kubernetes, vmware, alicloud, sepm, aci-direct, ibm, nutanix, sap] more...
    • update_interval (Alias name: update-interval) Dynamic object update interval (30 - 3600 sec, default = 60, 0 = disabled). type: int more...
    • use_metadata_iam (Alias name: use-metadata-iam) Enable/disable use of iam role from metadata to call api. type: str choices: [disable, enable] more...
    • user_id (Alias name: user-id) User id. type: str more...
    • username Username of the remote sdn connector as login credentials. type: str more...
    • vcenter_password (Alias name: vcenter-password) Vcenter server password for nsx quarantine. type: list more...
    • vcenter_server (Alias name: vcenter-server) Vcenter server address for nsx quarantine. type: str more...
    • vcenter_username (Alias name: vcenter-username) Vcenter server username for nsx quarantine. type: str more...
    • verify_certificate (Alias name: verify-certificate) Enable/disable server certificate verification. type: str choices: [disable, enable] more...
    • vpc_id (Alias name: vpc-id) Aws vpc id. type: str more...
    • proxy Sdn proxy. type: list more...
    • compartment_list (Alias name: compartment-list) Compartment list. type: list more...
      • compartment_id (Alias name: compartment-id) Oci compartment id. type: str more...
    • oci_region_list (Alias name: oci-region-list) Oci region list. type: list more...
      • region Oci region. type: str more...
    • rest_ssl (Alias name: rest-ssl) Rest ssl. type: str choices: [disable, enable] more...
    • vmx_image_url (Alias name: vmx-image-url) Url of web-hosted vmx image. type: str more...
    • rest_interface (Alias name: rest-interface) Interface name for rest service to listen on. type: str choices: [mgmt, sync] more...
    • rest_sport (Alias name: rest-sport) Rest service access port (1 - 65535). type: int more...
    • nsx_cert_fingerprint (Alias name: nsx-cert-fingerprint) Nsx certificate fingerprint. type: str more...
    • vmx_service_name (Alias name: vmx-service-name) Vmx service name. type: str more...
    • rest_password (Alias name: rest-password) Password for rest service. type: list more...
    • gcp_project (Alias name: gcp-project) Gcp project name. type: str more...
    • ibm_region_gen2 (Alias name: ibm-region-gen2) Ibm region gen2. type: str choices: [us-south, us-east, great-britain] more...
    • ibm_region_gen1 (Alias name: ibm-region-gen1) Ibm region gen1. type: str choices: [us-south, us-east, germany, great-britain, japan, australia] more...
    • server_ip (Alias name: server-ip) Server address of the remote sdn connector. type: str more...
    • microsoft_365 (Alias name: microsoft-365) Enable to use as microsoft 365 connector. type: str choices: [disable, enable] more...
    • vdom Virtual domain name of the remote sdn connector. type: list more...
    • message_server_port (Alias name: message-server-port) Http port number of the sap message server. type: int more...
    • par_id (Alias name: par-id) Public address range id. type: str more...

Notes

Note

  • Running in workspace locking mode is supported in this FortiManager module, the top level parameters workspace_locking_adom and workspace_locking_timeout help do the work.

  • To create or update an object, use state: present directive.

  • To delete an object, use state: absent directive

  • Normally, running one module can fail when a non-zero rc is returned. you can also override the conditions to fail or succeed with parameters rc_failed and rc_succeeded

Examples

- name: Example playbook (generated based on argument schema)
  hosts: fortimanagers
  connection: httpapi
  gather_facts: false
  vars:
    ansible_httpapi_use_ssl: true
    ansible_httpapi_validate_certs: false
    ansible_httpapi_port: 443
  tasks:
    - name: Configure connection to SDN Connector.
      fortinet.fmgdevice.fmgd_system_sdnconnector:
        # bypass_validation: false
        # workspace_locking_adom: <global or your adom name>
        # workspace_locking_timeout: 300
        # rc_succeeded: [0, -2, -3, ...]
        # rc_failed: [-2, -3, ...]
        device: <your own value>
        state: present # <value in [present, absent]>
        system_sdnconnector:
          name: "your value" # Required variable, string
          # _local_cert: <string>
          # access_key: <string>
          # alt_resource_ip: <value in [disable, enable]>
          # api_key: <list or string>
          # azure_region: <value in [global, china, germany, ...]>
          # client_id: <string>
          # client_secret: <list or string>
          # compartment_id: <string>
          # compute_generation: <integer>
          # domain: <string>
          # external_account_list:
          #   - external_id: <string>
          #     region_list: <list or string>
          #     role_arn: <string>
          # external_ip:
          #   - name: <string>
          # forwarding_rule:
          #   - rule_name: <string>
          #     target: <string>
          # gcp_project_list:
          #   - gcp_zone_list: <list or string>
          #     id: <string>
          # group_name: <string>
          # ha_status: <value in [disable, enable]>
          # ibm_region: <value in [dallas, washington-dc, london, ...]>
          # key_passwd: <list or string>
          # login_endpoint: <string>
          # nic:
          #   - ip:
          #       - name: <string>
          #         public_ip: <string>
          #         resource_group: <string>
          #         private_ip: <string>
          #     name: <string>
          #     peer_nic: <string>
          # oci_cert: <list or string>
          # oci_fingerprint: <string>
          # oci_region: <string>
          # oci_region_type: <value in [commercial, government]>
          # password: <list or string>
          # private_key: <string>
          # region: <string>
          # resource_group: <string>
          # resource_url: <string>
          # route:
          #   - name: <string>
          # route_table:
          #   - name: <string>
          #     resource_group: <string>
          #     route:
          #       - name: <string>
          #         next_hop: <string>
          #     subscription_id: <string>
          # secret_key: <list or string>
          # secret_token: <string>
          # server: <string>
          # server_ca_cert: <list or string>
          # server_cert: <list or string>
          # server_list: <list or string>
          # server_port: <integer>
          # service_account: <string>
          # status: <value in [disable, enable]>
          # subscription_id: <string>
          # tenant_id: <string>
          # type: <value in [aci, aws, nsx, ...]>
          # update_interval: <integer>
          # use_metadata_iam: <value in [disable, enable]>
          # user_id: <string>
          # username: <string>
          # vcenter_password: <list or string>
          # vcenter_server: <string>
          # vcenter_username: <string>
          # verify_certificate: <value in [disable, enable]>
          # vpc_id: <string>
          # proxy: <list or string>
          # compartment_list:
          #   - compartment_id: <string>
          # oci_region_list:
          #   - region: <string>
          # rest_ssl: <value in [disable, enable]>
          # vmx_image_url: <string>
          # rest_interface: <value in [mgmt, sync]>
          # rest_sport: <integer>
          # nsx_cert_fingerprint: <string>
          # vmx_service_name: <string>
          # rest_password: <list or string>
          # gcp_project: <string>
          # ibm_region_gen2: <value in [us-south, us-east, great-britain]>
          # ibm_region_gen1: <value in [us-south, us-east, germany, ...]>
          # server_ip: <string>
          # microsoft_365: <value in [disable, enable]>
          # vdom: <list or string>
          # message_server_port: <integer>
          # par_id: <string>

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:

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

Status

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

Authors

  • Xinwei Du (@dux-fortinet)

  • Xing Li (@lix-fortinet)

  • Jie Xue (@JieX19)

  • Link Zheng (@chillancezen)

  • Frank Shen (@fshen01)

  • Hongbin Lu (@fgtdev-hblu)