:source: fmgd_switchcontroller_global.py
:orphan:
.. _fmgd_switchcontroller_global:
fmgd_switchcontroller_global -- Configure FortiSwitch global settings.
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
.. 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
- 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
- switchcontroller_global - Configure FortiSwitch global settings. type: dict
- bounce_quarantined_link (Alias name: bounce-quarantined-link) Enable/disable bouncing (administratively bring the link down, up) of a switch port where a quarantined device was seen last. type: str choices: [disable, enable]
more...
Supported Version Ranges: v7.2.6 -> v7.2.12, v7.4.3 -> latest
- custom_command (Alias name: custom-command) Custom command. type: list
more...
Supported Version Ranges: v7.2.6 -> v7.2.12, v7.4.3 -> latest
- command_entry (Alias name: command-entry) List of fortiswitch commands. type: str
more...
Supported Version Ranges: v7.2.6 -> v7.2.12, v7.4.3 -> latest
- command_name (Alias name: command-name) Name of custom command to push to all fortiswitches in vdom. type: list
more...
Supported Version Ranges: v7.2.6 -> v7.2.12, v7.4.3 -> latest
- default_virtual_switch_vlan (Alias name: default-virtual-switch-vlan) Default vlan for ports when added to the virtual-switch. type: list
more...
Supported Version Ranges: v7.2.6 -> v7.2.12, v7.4.3 -> latest
- dhcp_option82_circuit_id (Alias name: dhcp-option82-circuit-id) List the parameters to be included to inform about client identification. type: list choices: [intfname, vlan, hostname, mode, description]
more...
Supported Version Ranges: v7.4.3 -> latest
- dhcp_option82_format (Alias name: dhcp-option82-format) Dhcp option-82 format string. type: str choices: [ascii, legacy]
more...
Supported Version Ranges: v7.4.3 -> latest
- dhcp_option82_remote_id (Alias name: dhcp-option82-remote-id) List the parameters to be included to inform about client identification. type: list choices: [mac, hostname, ip]
more...
Supported Version Ranges: v7.4.3 -> latest
- dhcp_server_access_list (Alias name: dhcp-server-access-list) Enable/disable dhcp snooping server access list. type: str choices: [disable, enable]
more...
Supported Version Ranges: v7.2.6 -> v7.2.12, v7.4.3 -> latest
- dhcp_snoop_client_db_exp (Alias name: dhcp-snoop-client-db-exp) Expiry time for dhcp snooping server database entries (300 - 259200 sec, default = 86400 sec). type: int
more...
Supported Version Ranges: v7.4.3 -> latest
- dhcp_snoop_client_req (Alias name: dhcp-snoop-client-req) Client dhcp packet broadcast mode. type: str choices: [drop-untrusted, forward-untrusted]
more...
Supported Version Ranges: v7.4.3 -> latest
- dhcp_snoop_db_per_port_learn_limit (Alias name: dhcp-snoop-db-per-port-learn-limit) Per interface dhcp-server entries learn limit (0 - 1024, default = 64). type: int
more...
Supported Version Ranges: v7.4.3 -> latest
- disable_discovery (Alias name: disable-discovery) Prevent this fortiswitch from discovering. type: list
more...
Supported Version Ranges: v7.2.6 -> v7.2.12, v7.4.3 -> latest
- fips_enforce (Alias name: fips-enforce) Enable/disable enforcement of fips on managed fortiswitch devices. type: str choices: [disable, enable]
more...
Supported Version Ranges: v7.2.6 -> v7.2.12, v7.4.3 -> latest
- firmware_provision_on_authorization (Alias name: firmware-provision-on-authorization) Enable/disable automatic provisioning of latest firmware on authorization. type: str choices: [disable, enable]
more...
Supported Version Ranges: v7.2.6 -> v7.2.12, v7.4.3 -> latest
- https_image_push (Alias name: https-image-push) Enable/disable image push to fortiswitch using https. type: str choices: [disable, enable]
more...
Supported Version Ranges: v7.2.6 -> v7.2.12, v7.4.3 -> latest
- log_mac_limit_violations (Alias name: log-mac-limit-violations) Enable/disable logs for learning limit violations. type: str choices: [disable, enable]
more...
Supported Version Ranges: v7.2.6 -> v7.2.12, v7.4.3 -> latest
- mac_aging_interval (Alias name: mac-aging-interval) Time after which an inactive mac is aged out (10 - 1000000 sec, default = 300, 0 = disable). type: int
more...
Supported Version Ranges: v7.2.6 -> v7.2.12, v7.4.3 -> latest
- mac_event_logging (Alias name: mac-event-logging) Enable/disable mac address event logging. type: str choices: [disable, enable]
more...
Supported Version Ranges: v7.2.6 -> v7.2.12, v7.4.3 -> latest
- mac_retention_period (Alias name: mac-retention-period) Time in hours after which an inactive mac is removed from client db (0 = aged out based on mac-aging-interval). type: int
more...
Supported Version Ranges: v7.2.6 -> v7.2.12, v7.4.3 -> latest
- mac_violation_timer (Alias name: mac-violation-timer) Set timeout for learning limit violations (0 = disabled). type: int
more...
Supported Version Ranges: v7.2.6 -> v7.2.12, v7.4.3 -> latest
- quarantine_mode (Alias name: quarantine-mode) Quarantine mode. type: str choices: [by-vlan, by-redirect]
more...
Supported Version Ranges: v7.2.6 -> v7.2.12, v7.4.3 -> latest
- sn_dns_resolution (Alias name: sn-dns-resolution) Enable/disable dns resolution of the fortiswitch units ip address with switch name. type: str choices: [disable, enable]
more...
Supported Version Ranges: v7.2.6 -> v7.2.12, v7.4.3 -> latest
- update_user_device (Alias name: update-user-device) Control which sources update the device user list. type: list choices: [mac-cache, lldp, dhcp-snooping, l2-db, l3-db]
more...
Supported Version Ranges: v7.2.6 -> v7.2.12, v7.4.3 -> latest
- vlan_all_mode (Alias name: vlan-all-mode) Vlan configuration mode, user-defined-vlans or all-possible-vlans. type: str choices: [defined, all]
more...
Supported Version Ranges: v7.2.6 -> v7.2.12, v7.4.3 -> latest
- vlan_identity (Alias name: vlan-identity) Identity of the vlan. type: str choices: [description, name]
more...
Supported Version Ranges: v7.2.6 -> v7.2.12, v7.4.3 -> latest
- vlan_optimization (Alias name: vlan-optimization) Fortilink vlan optimization. type: str choices: [disable, enable, prune, configured, none]
more...
Supported Version Ranges: v7.2.6 -> v7.2.12, v7.4.3 -> latest
- allow_multiple_interfaces (Alias name: allow-multiple-interfaces) Enable/disable multiple fortilink interfaces for redundant connections between a managed fortiswitch and fortigate. type: str choices: [disable, enable]
more...
Supported Version Ranges: v7.2.6 -> v7.2.12, v7.4.3 -> latest
- switch_on_deauth (Alias name: switch-on-deauth) No-operation/factory-reset the managed fortiswitch on deauthorization. type: str choices: [no-op, factory-reset]
more...
Supported Version Ranges: v7.4.6 -> v7.4.10, v7.6.2 -> latest
- firewall_auth_user_hold_period (Alias name: firewall-auth-user-hold-period) Time period in minutes to hold firewall authenticated mac users (5 - 1440, default = 5, disable = 0). type: int
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: Configure FortiSwitch global settings.
fortinet.fmgdevice.fmgd_switchcontroller_global:
# bypass_validation: false
# workspace_locking_adom:
# workspace_locking_timeout: 300
# rc_succeeded: [0, -2, -3, ...]
# rc_failed: [-2, -3, ...]
device:
vdom:
switchcontroller_global:
# bounce_quarantined_link:
# custom_command:
# - command_entry:
# command_name:
# default_virtual_switch_vlan:
# dhcp_option82_circuit_id:
# - "intfname"
# - "vlan"
# - "hostname"
# - "mode"
# - "description"
# dhcp_option82_format:
# dhcp_option82_remote_id:
# - "mac"
# - "hostname"
# - "ip"
# dhcp_server_access_list:
# dhcp_snoop_client_db_exp:
# dhcp_snoop_client_req:
# dhcp_snoop_db_per_port_learn_limit:
# disable_discovery:
# fips_enforce:
# firmware_provision_on_authorization:
# https_image_push:
# log_mac_limit_violations:
# mac_aging_interval:
# mac_event_logging:
# mac_retention_period:
# mac_violation_timer:
# quarantine_mode:
# sn_dns_resolution:
# update_user_device:
# - "mac-cache"
# - "lldp"
# - "dhcp-snooping"
# - "l2-db"
# - "l3-db"
# vlan_all_mode:
# vlan_identity:
# vlan_optimization:
# allow_multiple_interfaces:
# switch_on_deauth:
# firewall_auth_user_hold_period:
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)