fortinet.fortios.fortios_switch_controller_managed_switch module – Configure FortiSwitch devices that are managed by this FortiGate in Fortinet’s FortiOS and FortiGate.
Note
This module is part of the fortinet.fortios collection (version 2.1.6).
You might already have this collection installed if you are using the ansible
package.
It is not included in ansible-core
.
To check whether it is installed, run ansible-galaxy collection list
.
To install it, use: ansible-galaxy collection install fortinet.fortios
.
To use it in a playbook, specify: fortinet.fortios.fortios_switch_controller_managed_switch
.
New in version 2.0.0: of fortinet.fortios
Synopsis
This module is able to configure a FortiGate or FortiOS (FOS) device by allowing the user to set and modify switch_controller feature and managed_switch category. Examples include all parameters and values need to be adjusted to datasources before usage. Tested with FOS v6.0.0
Requirements
The below requirements are needed on the host that executes this module.
ansible>=2.9.0
Parameters
Parameter |
Comments |
---|---|
Token-based authentication. Generated from GUI of Fortigate. |
|
Enable/Disable logging for task. Choices:
|
|
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. |
|
Add or delete a member under specified attribute path. When member_state is specified, the state option is ignored. Choices:
|
|
Indicates whether to create or remove the object. Choices:
|
|
Configure FortiSwitch devices that are managed by this FortiGate. |
|
FortiSwitch access profile. Source switch-controller.security-policy.local-access.name. |
|
Configuration method to edit FortiSwitch commands to be pushed to this FortiSwitch device upon rebooting the FortiGate switch controller or the FortiSwitch. |
|
List of FortiSwitch commands. |
|
Names of commands to be pushed to this FortiSwitch device, as configured under config switch-controller custom-command. Source switch-controller.custom-command.command-name. |
|
Delayed restart triggered for this FortiSwitch. |
|
Description. |
|
DHCP snooping server access list. Choices:
|
|
Directly connected FortiSwitch. |
|
List of features this FortiSwitch supports (not configurable) that is sent to the FortiGate device for subsequent configuration initiated by the FortiGate device. |
|
Dynamically discovered FortiSwitch. |
|
Enable/disable provisioning of firmware to FortiSwitches on join connection. Choices:
|
|
Enable/disable one-time automatic provisioning of the latest firmware version. Choices:
|
|
Firmware version to provision to this FortiSwitch on bootup (major.minor.build, i.e. 6.2.1234). |
|
Flow-tracking netflow ipfix switch identity in hex format(00000000-FFFFFFFF ). |
|
FortiSwitch WAN1 admin status; enable to authorize the FortiSwitch as a managed switch. Choices:
|
|
FortiSwitch WAN1 peer port. Source system.interface.name. |
|
FortiSwitch WAN2 admin status; enable to authorize the FortiSwitch as a managed switch. Choices:
|
|
FortiSwitch WAN2 peer port. |
|
Configure FortiSwitch IGMP snooping global settings. |
|
Maximum time to retain a multicast snooping entry for which no packets have been seen (15 - 3600 sec). |
|
Enable/disable unknown multicast flooding. Choices:
|
|
Enable/disable overriding the global IGMP snooping configuration. Choices:
|
|
Configure IGMP snooping VLAN. |
|
IGMP snooping proxy for the VLAN interface. Choices:
|
|
Enable/disable IGMP snooping querier for the VLAN interface. Choices:
|
|
IGMP snooping querier address. |
|
IGMP snooping querying version. |
|
List of FortiSwitch VLANs. Source system.interface.name. |
|
IP source guard. |
|
IP and MAC address configuration. |
|
Configure binding pair. |
|
Source IP for this rule. |
|
MAC address for this rule. |
|
Description. |
|
Ingress interface to which source guard is bound. |
|
Layer 3 management discovered. |
|
FortiSwitch maximum allowed trunk members. |
|
Enable/disable MCLAG IGMP-snooping awareness. Choices:
|
|
Configuration method to edit FortiSwitch packet mirror. |
|
Destination port. |
|
Mirror name. |
|
Source egress interfaces. |
|
Interface name. |
|
Source ingress interfaces. |
|
Interface name. |
|
Active/inactive mirror configuration. Choices:
|
|
Enable/disable switching functionality when mirroring. Choices:
|
|
Managed-switch name. |
|
Enable/disable overriding the global SNMP communities. Choices:
|
|
Enable/disable overriding the global SNMP system information. Choices:
|
|
Enable/disable overriding the global SNMP trap threshold values. Choices:
|
|
Enable/disable overriding the global SNMP users. Choices:
|
|
VDOM which owner of port belongs to. |
|
PoE detection type for FortiSwitch. |
|
Enable/disable PoE LLDP detection. Choices:
|
|
Enable/disable PoE pre-standard detection. Choices:
|
|
Managed-switch port list. |
|
Access mode of the port. Choices:
|
|
LACP member select mode. Choices:
|
|
Configure switch port tagged VLANs. |
|
VLAN name. Source system.interface.name. |
|
Enable/disable all defined vlans on this port. Choices:
|
|
Trusted or untrusted dynamic ARP inspection. Choices:
|
|
Enable/disable Link Aggregation Group (LAG) bundling for non-FortiLink interfaces. Choices:
|
|
Description for port. |
|
Enable/disable allowance of DHCP with option-82 on untrusted interface. Choices:
|
|
Trusted or untrusted DHCP-snooping interface. Choices:
|
|
Configure discard mode for port. Choices:
|
|
Enable/disable this interface as an edge port, bridging connections between workstations and/or computers. Choices:
|
|
Configure export tag(s) for FortiSwitch port when exported to a virtual port pool. |
|
FortiSwitch port tag name when exported to a virtual port pool. Source switch-controller.switch-interface-tag.name. |
|
Export managed-switch port to a tenant VDOM. Source system.vdom.name. |
|
Switch controller export port to pool-list. Source switch-controller.virtual-port-pool.name. |
|
Switch controller export port to pool-list. |
|
FEC capable. |
|
State of forward error correction. Choices:
|
|
FGT peer device name. |
|
FGT peer port name. |
|
Fiber-port. |
|
Port properties flags. |
|
Flow control direction. Choices:
|
|
FortiLink uplink port. |
|
Set IGMP snooping mode for the physical port interface. Choices:
|
|
Enable/disable flooding of IGMP reports to this interface when igmp-snooping enabled. Choices:
|
|
Enable/disable flooding of IGMP snooping traffic to this interface. Choices:
|
|
Tag(s) associated with the interface for various features including virtual port pool, dynamic port policy. |
|
FortiSwitch port tag name when exported to a virtual port pool or matched to dynamic port policy. Source switch-controller.switch-interface-tag.name. |
|
Enable/disable IP source guard. Choices:
|
|
ISL local trunk name. |
|
ISL peer device name. |
|
ISL peer port name. |
|
End Link Aggregation Control Protocol (LACP) messages every 30 seconds (slow) or every second (fast). Choices:
|
|
Limit the number of dynamic MAC addresses on this Port (1 - 128, 0 = no limit, default). |
|
LLDP port TLV profile. Source switch-controller.lldp-profile.name. |
|
LLDP transmit and receive status. Choices:
|
|
Enable/disable loop-guard on this interface, an STP optimization used to prevent network loops. Choices:
|
|
Loop-guard timeout (0 - 120 min). |
|
Port/Trunk MAC. |
|
Matched interface tags in the dynamic port policy. |
|
Matched child policy in the dynamic port policy. |
|
Maximum size of LAG bundle (1 - 24). |
|
Enable/disable multi-chassis link aggregation (MCLAG). Choices:
|
|
MCLAG-ICL port. |
|
Media type. |
|
Port behavior after it withdraws because of loss of control packets. Choices:
|
|
Aggregated LAG bundle interfaces. |
|
Interface name from available options. |
|
Minimum size of LAG bundle (1 - 24). |
|
LACP mode: ignore and do not send control messages, or negotiate 802.3ad aggregation passively or actively. Choices:
|
|
General peer to peer tunnel port. |
|
Packet sampling rate (0 - 99999 p/sec). |
|
Enable/disable packet sampling on this interface. Choices:
|
|
Configure ingress pause metering rate, in kbps . |
|
Resume threshold for resuming traffic on ingress port. Choices:
|
|
PoE capable. |
|
PoE maximum power. |
|
Enable/disable PoE pre-standard detection. Choices:
|
|
PoE standard supported. |
|
Enable/disable PoE status. Choices:
|
|
Switch port name. |
|
Port number. |
|
Switch port name. |
|
Switch controller dynamic port policy from available options. Source switch-controller.dynamic-port-policy.name. |
|
Port prefix type. |
|
Switch controller authentication policy to apply to this managed switch from available options. Source switch-controller .security-policy.802-1X.name. |
|
Algorithm for aggregate port selection. Choices:
|
|
PTP policy configuration. Source switch-controller.ptp.policy.name. |
|
Switch controller QoS policy from available options. Source switch-controller.qos.qos-policy.name. |
|
Enable/disable inter-operability with rapid PVST on this interface. Choices:
|
|
Packet sampling direction. Choices:
|
|
sFlow sampling counter polling interval in seconds (0 - 255). |
|
sFlow sampler sample rate (0 - 99999 p/sec). |
|
Enable/disable sFlow protocol on this interface. Choices:
|
|
Switch port speed; default and available settings depend on hardware. Choices:
|
|
Switch port speed mask. |
|
Stacking port. |
|
Switch port admin status: up or down. Choices:
|
|
Enable or disable sticky-mac on the interface. Choices:
|
|
Switch controller storm control policy from available options. Source switch-controller.storm-control-policy.name. |
|
Enable/disable STP BPDU guard on this interface. Choices:
|
|
BPDU Guard disabling protection (0 - 120 min). |
|
Enable/disable STP root guard on this interface. Choices:
|
|
Enable/disable Spanning Tree Protocol (STP) on this interface. Choices:
|
|
Switch id. |
|
Interface type: physical or trunk port. Choices:
|
|
Configure switch port untagged VLANs. |
|
VLAN name. Source system.interface.name. |
|
Virtualized switch port. |
|
Assign switch ports to a VLAN. Source system.interface.name. |
|
Pre-provisioned managed switch. |
|
Set QoS drop-policy. Choices:
|
|
Set QoS RED/WRED drop probability. |
|
Configure logging by FortiSwitch device to a remote syslog server. |
|
Enable/disable comma-separated value (CSV) strings. Choices:
|
|
Facility to log to remote syslog server. Choices:
|
|
Remote log name. |
|
Remote syslog server listening port. |
|
IPv4 address of the remote syslog server. |
|
Severity of logs to be transferred to remote log server. Choices:
|
|
Enable/disable logging by FortiSwitch device to a remote syslog server. Choices:
|
|
Configuration method to edit FortiSwitch 802.1X global settings. |
|
Authentication state to set if a link is down. Choices:
|
|
Enable to override global 802.1X settings on individual FortiSwitches. Choices:
|
|
Maximum number of authentication attempts (0 - 15). |
|
Reauthentication time interval (1 - 1440 min). |
|
802.1X Tx period (seconds). |
|
Configuration method to edit Simple Network Management Protocol (SNMP) communities. |
|
SNMP notifications (traps) to send. Choices:
|
|
Configure IPv4 SNMP managers (hosts). |
|
Host entry ID. |
|
IPv4 address of the SNMP manager (host). |
|
SNMP community ID. |
|
SNMP community name. |
|
SNMP v1 query port . |
|
Enable/disable SNMP v1 queries. Choices:
|
|
SNMP v2c query port . |
|
Enable/disable SNMP v2c queries. Choices:
|
|
Enable/disable this SNMP community. Choices:
|
|
SNMP v2c trap local port . |
|
SNMP v2c trap remote port . |
|
Enable/disable SNMP v1 traps. Choices:
|
|
SNMP v2c trap local port . |
|
SNMP v2c trap remote port . |
|
Enable/disable SNMP v2c traps. Choices:
|
|
Configuration method to edit Simple Network Management Protocol (SNMP) system info. |
|
Contact information. |
|
System description. |
|
Local SNMP engine ID string (max 24 char). |
|
System location. |
|
Enable/disable SNMP. Choices:
|
|
Configuration method to edit Simple Network Management Protocol (SNMP) trap threshold values. |
|
CPU usage when trap is sent. |
|
Log disk usage when trap is sent. |
|
Memory usage when trap is sent. |
|
Configuration method to edit Simple Network Management Protocol (SNMP) users. |
|
Authentication protocol. Choices:
|
|
Password for authentication protocol. |
|
SNMP user name. |
|
Privacy (encryption) protocol. Choices:
|
|
Password for privacy (encryption) protocol. |
|
Enable/disable SNMP queries for this user. Choices:
|
|
SNMPv3 query port . |
|
Security level for message authentication and encryption. Choices:
|
|
Staged image version for FortiSwitch. |
|
Configuration method to edit FortiSwitch Static and Sticky MAC. |
|
Description. |
|
ID. |
|
Interface name. |
|
MAC address. |
|
Type. Choices:
|
|
Vlan. Source system.interface.name. |
|
Configuration method to edit FortiSwitch storm control for measuring traffic activity using data rates to prevent traffic disruption. |
|
Enable/disable storm control to drop broadcast traffic. Choices:
|
|
Enable to override global FortiSwitch storm control settings for this FortiSwitch. Choices:
|
|
Rate in packets per second at which storm traffic is controlled (1 - 10000000). Storm control drops excess traffic data rates beyond this threshold. |
|
Enable/disable storm control to drop unknown multicast traffic. Choices:
|
|
Enable/disable storm control to drop unknown unicast traffic. Choices:
|
|
Configuration method to edit Spanning Tree Protocol (STP) instances. |
|
Instance ID. |
|
Priority. Choices:
|
|
Configuration method to edit Spanning Tree Protocol (STP) settings used to prevent bridge loops. |
|
Period of time a port is in listening and learning state (4 - 30 sec). |
|
Period of time between successive STP frame Bridge Protocol Data Units (BPDUs) sent on a port (1 - 10 sec). |
|
Enable to configure local STP settings that override global STP settings. Choices:
|
|
Maximum time before a bridge port saves its configuration BPDU information (6 - 40 sec). |
|
Maximum number of hops between the root bridge and the furthest bridge (1- 40). |
|
Name of local STP settings configuration. |
|
Pending time (1 - 15 sec). |
|
STP revision number (0 - 65535). |
|
Enable/disable STP. Choices:
|
|
User definable label/tag. |
|
DHCP option43 key. |
|
Managed-switch id. |
|
Configuration method to edit FortiSwitch logging settings (logs are transferred to and inserted into the FortiGate event log). |
|
Enable to configure local logging settings that override global logging settings. Choices:
|
|
Severity of FortiSwitch logs that are added to the FortiGate event log. Choices:
|
|
Enable/disable adding FortiSwitch logs to the FortiGate event log. Choices:
|
|
FortiSwitch profile. Source switch-controller.switch-profile.name. |
|
Configure spanning tree protocol (STP). |
|
Enable/disable STP. Choices:
|
|
TDR supported. |
|
Indication of switch type, physical or virtual. Choices:
|
|
FortiSwitch version. |
|
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. Default: “root” |
Examples
- 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: Configure FortiSwitch devices that are managed by this FortiGate.
fortios_switch_controller_managed_switch:
vdom: "{{ vdom }}"
state: "present"
access_token: "<your_own_value>"
switch_controller_managed_switch:
settings_802_1X:
link_down_auth: "set-unauth"
local_override: "enable"
max_reauth_attempt: "6"
reauth_period: "7"
tx_period: "8"
access_profile: "<your_own_value> (source switch-controller.security-policy.local-access.name)"
custom_command:
-
command_entry: "<your_own_value>"
command_name: "<your_own_value> (source switch-controller.custom-command.command-name)"
delayed_restart_trigger: "13"
description: "<your_own_value>"
dhcp_server_access_list: "global"
directly_connected: "16"
dynamic_capability: "<your_own_value>"
dynamically_discovered: "18"
firmware_provision: "enable"
firmware_provision_latest: "disable"
firmware_provision_version: "<your_own_value>"
flow_identity: "<your_own_value>"
fsw_wan1_admin: "discovered"
fsw_wan1_peer: "<your_own_value> (source system.interface.name)"
fsw_wan2_admin: "discovered"
fsw_wan2_peer: "<your_own_value>"
igmp_snooping:
aging_time: "28"
flood_unknown_multicast: "enable"
local_override: "enable"
vlans:
-
proxy: "disable"
querier: "disable"
querier_addr: "<your_own_value>"
version: "35"
vlan_name: "<your_own_value> (source system.interface.name)"
ip_source_guard:
-
binding_entry:
-
entry_name: "<your_own_value>"
ip: "<your_own_value>"
mac: "<your_own_value>"
description: "<your_own_value>"
port: "<your_own_value>"
l3_discovered: "44"
max_allowed_trunk_members: "45"
mclag_igmp_snooping_aware: "enable"
mirror:
-
dst: "<your_own_value>"
name: "default_name_49"
src_egress:
-
name: "default_name_51"
src_ingress:
-
name: "default_name_53"
status: "active"
switching_packet: "enable"
name: "default_name_56"
override_snmp_community: "enable"
override_snmp_sysinfo: "disable"
override_snmp_trap_threshold: "enable"
override_snmp_user: "enable"
owner_vdom: "<your_own_value>"
poe_detection_type: "62"
poe_lldp_detection: "enable"
poe_pre_standard_detection: "enable"
ports:
-
access_mode: "dynamic"
aggregator_mode: "bandwidth"
allowed_vlans:
-
vlan_name: "<your_own_value> (source system.interface.name)"
allowed_vlans_all: "enable"
arp_inspection_trust: "untrusted"
bundle: "enable"
description: "<your_own_value>"
dhcp_snoop_option82_trust: "enable"
dhcp_snooping: "untrusted"
discard_mode: "none"
edge_port: "enable"
export_tags:
-
tag_name: "<your_own_value> (source switch-controller.switch-interface-tag.name)"
export_to: "<your_own_value> (source system.vdom.name)"
export_to_pool: "<your_own_value> (source switch-controller.virtual-port-pool.name)"
export_to_pool_flag: "82"
fec_capable: "84"
fec_state: "disabled"
fgt_peer_device_name: "<your_own_value>"
fgt_peer_port_name: "<your_own_value>"
fiber_port: "88"
flags: "89"
flow_control: "disable"
fortilink_port: "91"
igmp_snooping: "enable"
igmps_flood_reports: "enable"
igmps_flood_traffic: "enable"
interface_tags:
-
tag_name: "<your_own_value> (source switch-controller.switch-interface-tag.name)"
ip_source_guard: "disable"
isl_local_trunk_name: "<your_own_value>"
isl_peer_device_name: "<your_own_value>"
isl_peer_port_name: "<your_own_value>"
lacp_speed: "slow"
learning_limit: "102"
lldp_profile: "<your_own_value> (source switch-controller.lldp-profile.name)"
lldp_status: "disable"
loop_guard: "enabled"
loop_guard_timeout: "106"
mac_addr: "<your_own_value>"
matched_dpp_intf_tags: "<your_own_value>"
matched_dpp_policy: "<your_own_value>"
max_bundle: "110"
mclag: "enable"
mclag_icl_port: "112"
media_type: "<your_own_value>"
member_withdrawal_behavior: "forward"
members:
-
member_name: "<your_own_value>"
min_bundle: "117"
mode: "static"
p2p_port: "119"
packet_sample_rate: "120"
packet_sampler: "enabled"
pause_meter: "122"
pause_meter_resume: "75%"
poe_capable: "124"
poe_max_power: "<your_own_value>"
poe_pre_standard_detection: "enable"
poe_standard: "<your_own_value>"
poe_status: "enable"
port_name: "<your_own_value>"
port_number: "130"
port_owner: "<your_own_value>"
port_policy: "<your_own_value> (source switch-controller.dynamic-port-policy.name)"
port_prefix_type: "133"
port_security_policy: "<your_own_value> (source switch-controller.security-policy.802-1X.name)"
port_selection_criteria: "src-mac"
ptp_policy: "<your_own_value> (source switch-controller.ptp.policy.name)"
qos_policy: "<your_own_value> (source switch-controller.qos.qos-policy.name)"
rpvst_port: "disabled"
sample_direction: "tx"
sflow_counter_interval: "140"
sflow_sample_rate: "141"
sflow_sampler: "enabled"
speed: "10half"
speed_mask: "144"
stacking_port: "145"
status: "up"
sticky_mac: "enable"
storm_control_policy: "<your_own_value> (source switch-controller.storm-control-policy.name)"
stp_bpdu_guard: "enabled"
stp_bpdu_guard_timeout: "150"
stp_root_guard: "enabled"
stp_state: "enabled"
switch_id: "<your_own_value>"
type: "physical"
untagged_vlans:
-
vlan_name: "<your_own_value> (source system.interface.name)"
virtual_port: "157"
vlan: "<your_own_value> (source system.interface.name)"
pre_provisioned: "159"
qos_drop_policy: "taildrop"
qos_red_probability: "161"
remote_log:
-
csv: "enable"
facility: "kernel"
name: "default_name_165"
port: "166"
server: "192.168.100.40"
severity: "emergency"
status: "enable"
snmp_community:
-
events: "cpu-high"
hosts:
-
id: "173"
ip: "<your_own_value>"
id: "175"
name: "default_name_176"
query_v1_port: "177"
query_v1_status: "disable"
query_v2c_port: "179"
query_v2c_status: "disable"
status: "disable"
trap_v1_lport: "182"
trap_v1_rport: "183"
trap_v1_status: "disable"
trap_v2c_lport: "185"
trap_v2c_rport: "186"
trap_v2c_status: "disable"
snmp_sysinfo:
contact_info: "<your_own_value>"
description: "<your_own_value>"
engine_id: "<your_own_value>"
location: "<your_own_value>"
status: "disable"
snmp_trap_threshold:
trap_high_cpu_threshold: "195"
trap_log_full_threshold: "196"
trap_low_memory_threshold: "197"
snmp_user:
-
auth_proto: "md5"
auth_pwd: "<your_own_value>"
name: "default_name_201"
priv_proto: "aes128"
priv_pwd: "<your_own_value>"
queries: "disable"
query_port: "205"
security_level: "no-auth-no-priv"
staged_image_version: "<your_own_value>"
static_mac:
-
description: "<your_own_value>"
id: "210"
interface: "<your_own_value>"
mac: "<your_own_value>"
type: "static"
vlan: "<your_own_value> (source system.interface.name)"
storm_control:
broadcast: "enable"
local_override: "enable"
rate: "218"
unknown_multicast: "enable"
unknown_unicast: "enable"
stp_instance:
-
id: "222"
priority: "0"
stp_settings:
forward_time: "225"
hello_time: "226"
local_override: "enable"
max_age: "228"
max_hops: "229"
name: "default_name_230"
pending_timer: "231"
revision: "232"
status: "enable"
switch_device_tag: "<your_own_value>"
switch_dhcp_opt43_key: "<your_own_value>"
switch_id: "<your_own_value>"
switch_log:
local_override: "enable"
severity: "emergency"
status: "enable"
switch_profile: "<your_own_value> (source switch-controller.switch-profile.name)"
switch_stp_settings:
status: "enable"
tdr_supported: "<your_own_value>"
type: "virtual"
version: "246"
Return Values
Common return values are documented here, the following are the fields unique to this module:
Key |
Description |
---|---|
Build number of the fortigate image Returned: always Sample: “1547” |
|
Last method used to provision the content into FortiGate Returned: always Sample: “PUT” |
|
Last result given by FortiGate on last operation applied Returned: always Sample: “200” |
|
Master key (id) used in the last call to FortiGate Returned: success Sample: “id” |
|
Name of the table used to fulfill the request Returned: always Sample: “urlfilter” |
|
Path of the table used to fulfill the request Returned: always Sample: “webfilter” |
|
Internal revision number Returned: always Sample: “17.0.2.10658” |
|
Serial number of the unit Returned: always Sample: “FGVMEVYYQT3AB5352” |
|
Indication of the operation’s result Returned: always Sample: “success” |
|
Virtual domain used Returned: always Sample: “root” |
|
Version of the FortiGate Returned: always Sample: “v5.6.3” |
Authors
Link Zheng (@chillancezen)
Jie Xue (@JieX19)
Hongbin Lu (@fgtdev-hblu)
Frank Shen (@frankshen01)
Miguel Angel Munoz (@mamunozgonzalez)
Nicolas Thomas (@thomnico)