fmgd_switchcontroller_global – Configure FortiSwitch global settings.
Added in version 1.0.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.2.6 -> v7.2.12, v7.4.3 -> 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
- 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...
- custom_command (Alias name: custom-command) Custom command. type: list more...
- default_virtual_switch_vlan (Alias name: default-virtual-switch-vlan) Default vlan for ports when added to the virtual-switch. type: list more...
- 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...
- dhcp_option82_format (Alias name: dhcp-option82-format) Dhcp option-82 format string. type: str choices: [ascii, legacy] more...
- 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...
- dhcp_server_access_list (Alias name: dhcp-server-access-list) Enable/disable dhcp snooping server access list. type: str choices: [disable, enable] more...
- 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...
- dhcp_snoop_client_req (Alias name: dhcp-snoop-client-req) Client dhcp packet broadcast mode. type: str choices: [drop-untrusted, forward-untrusted] more...
- 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...
- disable_discovery (Alias name: disable-discovery) Prevent this fortiswitch from discovering. type: list more...
- fips_enforce (Alias name: fips-enforce) Enable/disable enforcement of fips on managed fortiswitch devices. type: str choices: [disable, enable] more...
- 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...
- https_image_push (Alias name: https-image-push) Enable/disable image push to fortiswitch using https. type: str choices: [disable, enable] more...
- log_mac_limit_violations (Alias name: log-mac-limit-violations) Enable/disable logs for learning limit violations. type: str choices: [disable, enable] more...
- 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...
- mac_event_logging (Alias name: mac-event-logging) Enable/disable mac address event logging. type: str choices: [disable, enable] more...
- 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...
- mac_violation_timer (Alias name: mac-violation-timer) Set timeout for learning limit violations (0 = disabled). type: int more...
- quarantine_mode (Alias name: quarantine-mode) Quarantine mode. type: str choices: [by-vlan, by-redirect] more...
- 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...
- 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...
- vlan_all_mode (Alias name: vlan-all-mode) Vlan configuration mode, user-defined-vlans or all-possible-vlans. type: str choices: [defined, all] more...
- vlan_identity (Alias name: vlan-identity) Identity of the vlan. type: str choices: [description, name] more...
- vlan_optimization (Alias name: vlan-optimization) Fortilink vlan optimization. type: str choices: [disable, enable, prune, configured, none] more...
- 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...
- 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...
- 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...
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 FortiSwitch global settings.
fortinet.fmgdevice.fmgd_switchcontroller_global:
# 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>
vdom: <your own value>
switchcontroller_global:
# bounce_quarantined_link: <value in [disable, enable]>
# custom_command:
# - command_entry: <string>
# command_name: <list or string>
# default_virtual_switch_vlan: <list or string>
# dhcp_option82_circuit_id:
# - "intfname"
# - "vlan"
# - "hostname"
# - "mode"
# - "description"
# dhcp_option82_format: <value in [ascii, legacy]>
# dhcp_option82_remote_id:
# - "mac"
# - "hostname"
# - "ip"
# dhcp_server_access_list: <value in [disable, enable]>
# dhcp_snoop_client_db_exp: <integer>
# dhcp_snoop_client_req: <value in [drop-untrusted, forward-untrusted]>
# dhcp_snoop_db_per_port_learn_limit: <integer>
# disable_discovery: <list or string>
# fips_enforce: <value in [disable, enable]>
# firmware_provision_on_authorization: <value in [disable, enable]>
# https_image_push: <value in [disable, enable]>
# log_mac_limit_violations: <value in [disable, enable]>
# mac_aging_interval: <integer>
# mac_event_logging: <value in [disable, enable]>
# mac_retention_period: <integer>
# mac_violation_timer: <integer>
# quarantine_mode: <value in [by-vlan, by-redirect]>
# sn_dns_resolution: <value in [disable, enable]>
# update_user_device:
# - "mac-cache"
# - "lldp"
# - "dhcp-snooping"
# - "l2-db"
# - "l3-db"
# vlan_all_mode: <value in [defined, all]>
# vlan_identity: <value in [description, name]>
# vlan_optimization: <value in [disable, enable, prune, ...]>
# allow_multiple_interfaces: <value in [disable, enable]>
# switch_on_deauth: <value in [no-op, factory-reset]>
# firewall_auth_user_hold_period: <integer>
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.