:source: fmgd_system_sdwan_service.py
:orphan:
.. _fmgd_system_sdwan_service:
fmgd_system_sdwan_service -- Create SD-WAN rules (also called services) to control how sessions are distributed to interfaces in the SD-WAN.
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
.. versionadded:: 1.0.0
.. contents::
:local:
:depth: 1
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
----------------------------------
.. raw:: html
Supported Version Ranges: v7.2.6 -> v7.2.12, v7.4.3 -> latest
Parameters
----------
.. raw:: html
- 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
- vdom - The parameter in requested url type: str required: true
- system_sdwan_service - Create SD-WAN rules type: dict
- addr_mode (Alias name: addr-mode) Address mode (ipv4 or ipv6). type: str choices: [ipv4, ipv6]
more...
Supported Version Ranges: v7.2.6 -> v7.2.12, v7.4.3 -> latest
- agent_exclusive (Alias name: agent-exclusive) Set/unset the service as agent use exclusively. type: str choices: [disable, enable]
more...
Supported Version Ranges: v7.2.6 -> v7.2.12, v7.4.3 -> latest
- bandwidth_weight (Alias name: bandwidth-weight) Coefficient of reciprocal of available bidirectional bandwidth in the formula of custom-profile-1. type: int
more...
Supported Version Ranges: v7.2.6 -> v7.2.12, v7.4.3 -> latest
- default Enable/disable use of sd-wan as default service. type: str choices: [disable, enable]
more...
Supported Version Ranges: v7.2.6 -> v7.2.12, v7.4.3 -> latest
- dscp_forward (Alias name: dscp-forward) Enable/disable forward traffic dscp tag. type: str choices: [disable, enable]
more...
Supported Version Ranges: v7.2.6 -> v7.2.12, v7.4.3 -> latest
- dscp_forward_tag (Alias name: dscp-forward-tag) Forward traffic dscp tag. type: str
more...
Supported Version Ranges: v7.2.6 -> v7.2.12, v7.4.3 -> latest
- dscp_reverse (Alias name: dscp-reverse) Enable/disable reverse traffic dscp tag. type: str choices: [disable, enable]
more...
Supported Version Ranges: v7.2.6 -> v7.2.12, v7.4.3 -> latest
- dscp_reverse_tag (Alias name: dscp-reverse-tag) Reverse traffic dscp tag. type: str
more...
Supported Version Ranges: v7.2.6 -> v7.2.12, v7.4.3 -> latest
- dst Destination address name. type: list
more...
Supported Version Ranges: v7.2.6 -> v7.2.12, v7.4.3 -> latest
- dst_negate (Alias name: dst-negate) Enable/disable negation of destination address match. type: str choices: [disable, enable]
more...
Supported Version Ranges: v7.2.6 -> v7.2.12, v7.4.3 -> latest
- dst6 Destination address6 name. type: list
more...
Supported Version Ranges: v7.2.6 -> v7.2.12, v7.4.3 -> latest
- end_port (Alias name: end-port) End destination port number. type: int
more...
Supported Version Ranges: v7.2.6 -> v7.2.12, v7.4.3 -> latest
- end_src_port (Alias name: end-src-port) End source port number. type: int
more...
Supported Version Ranges: v7.4.3 -> latest
- gateway Enable/disable sd-wan service gateway. type: str choices: [disable, enable]
more...
Supported Version Ranges: v7.2.6 -> v7.2.12, v7.4.3 -> latest
- groups User groups. type: list
more...
Supported Version Ranges: v7.2.6 -> v7.2.12, v7.4.3 -> latest
- hash_mode (Alias name: hash-mode) Hash algorithm for selected priority members for load balance mode. type: str choices: [round-robin, source-ip-based, source-dest-ip-based, inbandwidth, outbandwidth, bibandwidth]
more...
Supported Version Ranges: v7.2.6 -> v7.2.12, v7.4.3 -> latest
- health_check (Alias name: health-check) Health check list. type: list
more...
Supported Version Ranges: v7.2.6 -> v7.2.12, v7.4.3 -> latest
- hold_down_time (Alias name: hold-down-time) Waiting period in seconds when switching from the back-up member to the primary member (0 - 10000000, default = 0). type: int
more...
Supported Version Ranges: v7.2.6 -> v7.2.12, v7.4.3 -> latest
- id Sd-wan rule id (1 - 4000). type: int
more...
Supported Version Ranges: v7.2.6 -> v7.2.12, v7.4.3 -> latest
- input_device (Alias name: input-device) Source interface name. type: list
more...
Supported Version Ranges: v7.2.6 -> v7.2.12, v7.4.3 -> latest
- input_device_negate (Alias name: input-device-negate) Enable/disable negation of input device match. type: str choices: [disable, enable]
more...
Supported Version Ranges: v7.2.6 -> v7.2.12, v7.4.3 -> latest
- input_zone (Alias name: input-zone) Source input-zone name. type: list
more...
Supported Version Ranges: v7.2.6 -> v7.2.12, v7.4.3 -> latest
- internet_service (Alias name: internet-service) Enable/disable use of internet service for application-based load balancing. type: str choices: [disable, enable]
more...
Supported Version Ranges: v7.2.6 -> v7.2.12, v7.4.3 -> latest
- internet_service_app_ctrl (Alias name: internet-service-app-ctrl) Application control based internet service id list. type: list
more...
Supported Version Ranges: v7.2.6 -> v7.2.12, v7.4.3 -> latest
- internet_service_app_ctrl_category (Alias name: internet-service-app-ctrl-category) Ids of one or more application control categories. type: list
more...
Supported Version Ranges: v7.2.6 -> v7.2.12, v7.4.3 -> latest
- internet_service_app_ctrl_group (Alias name: internet-service-app-ctrl-group) Application control based internet service group list. type: list
more...
Supported Version Ranges: v7.2.6 -> v7.2.12, v7.4.3 -> latest
- internet_service_custom (Alias name: internet-service-custom) Custom internet service name list. type: list
more...
Supported Version Ranges: v7.2.6 -> v7.2.12, v7.4.3 -> latest
- internet_service_custom_group (Alias name: internet-service-custom-group) Custom internet service group list. type: list
more...
Supported Version Ranges: v7.2.6 -> v7.2.12, v7.4.3 -> latest
- internet_service_group (Alias name: internet-service-group) Internet service group list. type: list
more...
Supported Version Ranges: v7.2.6 -> v7.2.12, v7.4.3 -> latest
- internet_service_name (Alias name: internet-service-name) Internet service name list. type: list
more...
Supported Version Ranges: v7.2.6 -> v7.2.12, v7.4.3 -> latest
- jitter_weight (Alias name: jitter-weight) Coefficient of jitter in the formula of custom-profile-1. type: int
more...
Supported Version Ranges: v7.2.6 -> v7.2.12, v7.4.3 -> latest
- latency_weight (Alias name: latency-weight) Coefficient of latency in the formula of custom-profile-1. type: int
more...
Supported Version Ranges: v7.2.6 -> v7.2.12, v7.4.3 -> latest
- link_cost_factor (Alias name: link-cost-factor) Link cost factor. type: str choices: [latency, jitter, packet-loss, inbandwidth, outbandwidth, bibandwidth, custom-profile-1]
more...
Supported Version Ranges: v7.2.6 -> v7.2.12, v7.4.3 -> latest
- link_cost_threshold (Alias name: link-cost-threshold) Percentage threshold change of link cost values that will result in policy route regeneration (0 - 10000000, default = 10). type: int
more...
Supported Version Ranges: v7.2.6 -> v7.2.12, v7.4.3 -> latest
- load_balance (Alias name: load-balance) Enable/disable load-balance. type: str choices: [disable, enable]
more...
Supported Version Ranges: v7.4.3 -> latest
- minimum_sla_meet_members (Alias name: minimum-sla-meet-members) Minimum number of members which meet sla. type: int
more...
Supported Version Ranges: v7.2.6 -> v7.2.12, v7.4.3 -> latest
- mode Control how the sd-wan rule sets the priority of interfaces in the sd-wan. type: str choices: [auto, manual, priority, sla, load-balance]
more...
Supported Version Ranges: v7.2.6 -> v7.2.12, v7.4.3 -> latest
- name Sd-wan rule name. type: str
more...
Supported Version Ranges: v7.2.6 -> v7.2.12, v7.4.3 -> latest
- packet_loss_weight (Alias name: packet-loss-weight) Coefficient of packet-loss in the formula of custom-profile-1. type: int
more...
Supported Version Ranges: v7.2.6 -> v7.2.12, v7.4.3 -> latest
- passive_measurement (Alias name: passive-measurement) Enable/disable passive measurement based on the service criteria. type: str choices: [disable, enable]
more...
Supported Version Ranges: v7.2.6 -> v7.2.12, v7.4.3 -> latest
- priority_members (Alias name: priority-members) Member sequence number list. type: list
more...
Supported Version Ranges: v7.2.6 -> v7.2.12, v7.4.3 -> latest
- priority_zone (Alias name: priority-zone) Priority zone name list. type: list
more...
Supported Version Ranges: v7.2.6 -> v7.2.12, v7.4.3 -> latest
- protocol Protocol number. type: int
more...
Supported Version Ranges: v7.2.6 -> v7.2.12, v7.4.3 -> latest
- quality_link (Alias name: quality-link) Quality grade. type: int
more...
Supported Version Ranges: v7.2.6 -> v7.2.12, v7.4.3 -> latest
- role Service role to work with neighbor. type: str choices: [primary, secondary, standalone]
more...
Supported Version Ranges: v7.2.6 -> v7.2.12, v7.4.3 -> latest
- shortcut Enable/disable shortcut for this service. type: str choices: [disable, enable]
more...
Supported Version Ranges: v7.4.3 -> latest
- shortcut_priority (Alias name: shortcut-priority) High priority of advpn shortcut for this service. type: str choices: [disable, enable, auto]
more...
Supported Version Ranges: v7.4.3 -> latest
- sla Sla. type: list
more...
Supported Version Ranges: v7.2.6 -> v7.2.12, v7.4.3 -> latest
- health_check (Alias name: health-check) Sd-wan health-check. type: list
more...
Supported Version Ranges: v7.2.6 -> v7.2.12, v7.4.3 -> latest
- id Sla id. type: int
more...
Supported Version Ranges: v7.2.6 -> v7.2.12, v7.4.3 -> latest
- sla_compare_method (Alias name: sla-compare-method) Method to compare sla value for sla mode. type: str choices: [order, number]
more...
Supported Version Ranges: v7.2.6 -> v7.2.12, v7.4.3 -> latest
- sla_stickiness (Alias name: sla-stickiness) Enable/disable sla stickiness (default = disable). type: str choices: [disable, enable]
more...
Supported Version Ranges: v7.4.3 -> latest
- src Source address name. type: list
more...
Supported Version Ranges: v7.2.6 -> v7.2.12, v7.4.3 -> latest
- src_negate (Alias name: src-negate) Enable/disable negation of source address match. type: str choices: [disable, enable]
more...
Supported Version Ranges: v7.2.6 -> v7.2.12, v7.4.3 -> latest
- src6 Source address6 name. type: list
more...
Supported Version Ranges: v7.2.6 -> v7.2.12, v7.4.3 -> latest
- standalone_action (Alias name: standalone-action) Enable/disable service when selected neighbor role is standalone while service role is not standalone. type: str choices: [disable, enable]
more...
Supported Version Ranges: v7.2.6 -> v7.2.12, v7.4.3 -> latest
- start_port (Alias name: start-port) Start destination port number. type: int
more...
Supported Version Ranges: v7.2.6 -> v7.2.12, v7.4.3 -> latest
- start_src_port (Alias name: start-src-port) Start source port number. type: int
more...
Supported Version Ranges: v7.4.3 -> latest
- status Enable/disable sd-wan service. type: str choices: [disable, enable]
more...
Supported Version Ranges: v7.2.6 -> v7.2.12, v7.4.3 -> latest
- tie_break (Alias name: tie-break) Method of selecting member if more than one meets the sla. type: str choices: [zone, cfg-order, fib-best-match, input-device, priority]
more...
Supported Version Ranges: v7.2.6 -> v7.2.12, v7.4.3 -> latest
- tos Type of service bit pattern. type: str
more...
Supported Version Ranges: v7.2.6 -> v7.2.12, v7.4.3 -> latest
- tos_mask (Alias name: tos-mask) Type of service evaluated bits. type: str
more...
Supported Version Ranges: v7.2.6 -> v7.2.12, v7.4.3 -> latest
- use_shortcut_sla (Alias name: use-shortcut-sla) Enable/disable use of advpn shortcut for quality comparison. type: str choices: [disable, enable]
more...
Supported Version Ranges: v7.2.6 -> v7.2.12, v7.4.3 -> latest
- users User name. type: list
more...
Supported Version Ranges: v7.2.6 -> v7.2.12, v7.4.3 -> latest
- zone_mode (Alias name: zone-mode) Enable/disable zone mode. type: str choices: [disable, enable]
more...
Supported Version Ranges: v7.4.3 -> latest
- route_tag (Alias name: route-tag) Ipv4 route map route-tag. type: int
more...
Supported Version Ranges: v7.2.6 -> v7.2.12, v7.4.3 -> latest
- comment Comments. type: str
more...
Supported Version Ranges: v7.6.0 -> latest
- fib_best_match_force (Alias name: fib-best-match-force) Enable/disable force using fib-best-match oif as outgoing interface. type: str choices: [disable, enable]
more...
Supported Version Ranges: v7.4.9 -> v7.4.10, v7.6.3 -> latest
- internet_service_fortiguard (Alias name: internet-service-fortiguard) Fortiguard internet service name list. type: list
more...
Supported Version Ranges: v7.6.4 -> latest
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
--------
.. code-block:: yaml+jinja
- 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: Create SD-WAN rules
fortinet.fmgdevice.fmgd_system_sdwan_service:
# bypass_validation: false
# workspace_locking_adom:
# workspace_locking_timeout: 300
# rc_succeeded: [0, -2, -3, ...]
# rc_failed: [-2, -3, ...]
device:
vdom:
state: present #
system_sdwan_service:
id: 0 # Required variable, integer
# addr_mode:
# agent_exclusive:
# bandwidth_weight:
# default:
# dscp_forward:
# dscp_forward_tag:
# dscp_reverse:
# dscp_reverse_tag:
# dst:
# dst_negate:
# dst6:
# end_port:
# end_src_port:
# gateway:
# groups:
# hash_mode:
# health_check:
# hold_down_time:
# input_device:
# input_device_negate:
# input_zone:
# internet_service:
# internet_service_app_ctrl:
# internet_service_app_ctrl_category:
# internet_service_app_ctrl_group:
# internet_service_custom:
# internet_service_custom_group:
# internet_service_group:
# internet_service_name:
# jitter_weight:
# latency_weight:
# link_cost_factor:
# link_cost_threshold:
# load_balance:
# minimum_sla_meet_members:
# mode:
# name:
# packet_loss_weight:
# passive_measurement:
# priority_members:
# priority_zone:
# protocol:
# quality_link:
# role:
# shortcut:
# shortcut_priority:
# sla:
# - health_check:
# id:
# sla_compare_method:
# sla_stickiness:
# src:
# src_negate:
# src6:
# standalone_action:
# start_port:
# start_src_port:
# status:
# tie_break:
# tos:
# tos_mask:
# use_shortcut_sla:
# users:
# zone_mode:
# route_tag:
# comment:
# fib_best_match_force:
# internet_service_fortiguard:
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:
.. raw:: html
- 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)