fmgr_switchcontroller_managedswitch_ports – Managed-switch port list.
Added in version 2.0.0.
Warning
Starting in version 3.0.0, all input arguments will be named using the underscore naming convention (snake_case).
Argument name before 3.0.0:
var-name
,var name
,var.name
New argument name starting in 3.0.0:
var_name
FortiManager Ansible v2.4+ supports both previous argument name and new underscore name. You will receive deprecation warnings if you keep using the previous argument name. You can ignore the warning by setting deprecation_warnings=False in ansible.cfg.
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>=2.15.0
FortiManager Version Compatibility
Supported Version Ranges: v6.0.0 -> 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
- adom - The parameter in requested url type: str required: true
- managed-switch - The parameter in requested url type: str required: true
- switchcontroller_managedswitch_ports - Managed-switch port list. type: dict
- allowed_vlans (Alias name: allowed-vlans) Configure switch port tagged vlans type: list or str more...
- allowed_vlans_all (Alias name: allowed-vlans-all) Enable/disable all defined vlans on this port. type: str choices: [disable, enable] more...
- arp_inspection_trust (Alias name: arp-inspection-trust) Trusted or untrusted dynamic arp inspection. type: str choices: [untrusted, trusted] more...
- bundle Enable/disable link aggregation group (lag) bundling for non-fortilink interfaces. type: str choices: [disable, enable] more...
- description Description for port. type: str more...
- dhcp_snoop_option82_trust (Alias name: dhcp-snoop-option82-trust) Enable/disable allowance of dhcp with option-82 on untrusted interface. type: str choices: [disable, enable] more...
- dhcp_snooping (Alias name: dhcp-snooping) Trusted or untrusted dhcp-snooping interface. type: str choices: [trusted, untrusted] more...
- discard_mode (Alias name: discard-mode) Configure discard mode for port. type: str choices: [none, all-untagged, all-tagged] more...
- edge_port (Alias name: edge-port) Enable/disable this interface as an edge port, bridging connections between workstations and/or computers. type: str choices: [disable, enable] more...
- igmp_snooping (Alias name: igmp-snooping) Set igmp snooping mode for the physical port interface. type: str choices: [disable, enable] more...
- igmps_flood_reports (Alias name: igmps-flood-reports) Enable/disable flooding of igmp reports to this interface when igmp-snooping enabled. type: str choices: [disable, enable] more...
- igmps_flood_traffic (Alias name: igmps-flood-traffic) Enable/disable flooding of igmp snooping traffic to this interface. type: str choices: [disable, enable] more...
- lacp_speed (Alias name: lacp-speed) End link aggregation control protocol (lacp) messages every 30 seconds (slow) or every second (fast). type: str choices: [slow, fast] more...
- learning_limit (Alias name: learning-limit) Limit the number of dynamic mac addresses on this port (1 - 128, 0 = no limit, default). type: int more...
- lldp_profile (Alias name: lldp-profile) Lldp port tlv profile. type: str more...
- lldp_status (Alias name: lldp-status) Lldp transmit and receive status. type: str choices: [disable, rx-only, tx-only, tx-rx] more...
- loop_guard (Alias name: loop-guard) Enable/disable loop-guard on this interface, an stp optimization used to prevent network loops. type: str choices: [disabled, enabled] more...
- loop_guard_timeout (Alias name: loop-guard-timeout) Loop-guard timeout (0 - 120 min, default = 45). type: int more...
- max_bundle (Alias name: max-bundle) Maximum size of lag bundle (1 - 24, default = 24) type: int more...
- mclag Enable/disable multi-chassis link aggregation (mclag). type: str choices: [disable, enable] more...
- member_withdrawal_behavior (Alias name: member-withdrawal-behavior) Port behavior after it withdraws because of loss of control packets. type: str choices: [forward, block] more...
- members Aggregated lag bundle interfaces. type: list more...
- min_bundle (Alias name: min-bundle) Minimum size of lag bundle (1 - 24, default = 1) type: int more...
- mode Lacp mode: ignore and do not send control messages, or negotiate 802. type: str choices: [static, lacp-passive, lacp-active] more...
- poe_pre_standard_detection (Alias name: poe-pre-standard-detection) Enable/disable poe pre-standard detection. type: str choices: [disable, enable] more...
- poe_status (Alias name: poe-status) Enable/disable poe status. type: str choices: [disable, enable] more...
- port_name (Alias name: port-name) Switch port name. type: str more...
- port_owner (Alias name: port-owner) Switch port name. type: str more...
- port_security_policy (Alias name: port-security-policy) Switch controller authentication policy to apply to this managed switch from available options. type: str more...
- port_selection_criteria (Alias name: port-selection-criteria) Algorithm for aggregate port selection. type: str choices: [src-mac, dst-mac, src-dst-mac, src-ip, dst-ip, src-dst-ip] more...
- qos_policy (Alias name: qos-policy) Switch controller qos policy from available options. type: str more...
- sample_direction (Alias name: sample-direction) Sflow sample direction. type: str choices: [rx, tx, both] more...
- sflow_counter_interval (Alias name: sflow-counter-interval) Sflow sampler counter polling interval (1 - 255 sec). type: int more...
- sflow_sample_rate (Alias name: sflow-sample-rate) Sflow sampler sample rate (0 - 99999 p/sec). type: int more...
- sflow_sampler (Alias name: sflow-sampler) Enable/disable sflow protocol on this interface. type: str choices: [disabled, enabled] more...
- stp_bpdu_guard (Alias name: stp-bpdu-guard) Enable/disable stp bpdu guard on this interface. type: str choices: [disabled, enabled] more...
- stp_bpdu_guard_timeout (Alias name: stp-bpdu-guard-timeout) Bpdu guard disabling protection (0 - 120 min). type: int more...
- stp_root_guard (Alias name: stp-root-guard) Enable/disable stp root guard on this interface. type: str choices: [disabled, enabled] more...
- stp_state (Alias name: stp-state) Enable/disable spanning tree protocol (stp) on this interface. type: str choices: [disabled, enabled] more...
- type Interface type: physical or trunk port. type: str choices: [physical, trunk] more...
- untagged_vlans (Alias name: untagged-vlans) Configure switch port untagged vlans type: list or str more...
- vlan Assign switch ports to a vlan. type: str more...
- export_to_pool_flag (Alias name: export-to-pool-flag) Switch controller export port to pool-list. type: int more...
- mac_addr (Alias name: mac-addr) Port/trunk mac. type: str more...
- packet_sample_rate (Alias name: packet-sample-rate) Packet sampling rate (0 - 99999 p/sec). type: int more...
- packet_sampler (Alias name: packet-sampler) Enable/disable packet sampling on this interface. type: str choices: [disabled, enabled] more...
- sticky_mac (Alias name: sticky-mac) Enable or disable sticky-mac on the interface. type: str choices: [disable, enable] more...
- storm_control_policy (Alias name: storm-control-policy) Switch controller storm control policy from available options. type: str more...
- dot1x_enable (Alias name: dot1x-enable) Dot1x enable. type: str choices: [disable, enable] more...
- max_miss_heartbeats (Alias name: max-miss-heartbeats) Maximum tolerant missed heartbeats. type: int more...
- access_mode (Alias name: access-mode) Access mode of the port. type: str choices: [normal, nac, dynamic, static] more...
- ip_source_guard (Alias name: ip-source-guard) Enable/disable ip source guard. type: str choices: [disable, enable] more...
- mclag_icl_port (Alias name: mclag-icl-port) Mclag icl port. type: int more...
- p2p_port (Alias name: p2p-port) P2p port. type: int more...
- aggregator_mode (Alias name: aggregator-mode) Lacp member select mode. type: str choices: [bandwidth, count] more...
- rpvst_port (Alias name: rpvst-port) Enable/disable inter-operability with rapid pvst on this interface. type: str choices: [disabled, enabled] more...
- flow_control (Alias name: flow-control) Flow control direction. type: str choices: [disable, tx, rx, both] more...
- media_type (Alias name: media-type) Media type. type: str more...
- pause_meter (Alias name: pause-meter) Configure ingress pause metering rate, in kbps (default = 0, disabled). type: int more...
- pause_meter_resume (Alias name: pause-meter-resume) Resume threshold for resuming traffic on ingress port. type: str choices: [25%, 50%, 75%] more...
- trunk_member (Alias name: trunk-member) Trunk member. type: int more...
- fec_capable (Alias name: fec-capable) Fec capable. type: int more...
- fec_state (Alias name: fec-state) State of forward error correction. type: str choices: [disabled, cl74, cl91, detect-by-module] more...
- matched_dpp_intf_tags (Alias name: matched-dpp-intf-tags) Matched interface tags in the dynamic port policy. type: str more...
- matched_dpp_policy (Alias name: matched-dpp-policy) Matched child policy in the dynamic port policy. type: str more...
- port_policy (Alias name: port-policy) Switch controller dynamic port policy from available options. type: str more...
- status Switch port admin status: up or down. type: str choices: [down, up] more...
- dsl_profile (Alias name: dsl-profile) Dsl policy configuration. type: str more...
- flap_duration (Alias name: flap-duration) Period over which flap events are calculated (seconds). type: int more...
- flap_rate (Alias name: flap-rate) Number of stage change events needed within flap-duration. type: int more...
- flap_timeout (Alias name: flap-timeout) Flap guard disabling protection (min). type: int more...
- flapguard Enable/disable flap guard. type: str choices: [disable, enable] more...
- interface_tags (Alias name: interface-tags) Tag(s) associated with the interface for various features including virtual port pool, dynamic port policy. type: list or str more...
- poe_max_power (Alias name: poe-max-power) Poe max power. type: str more...
- poe_standard (Alias name: poe-standard) Poe standard. type: str more...
- igmp_snooping_flood_reports (Alias name: igmp-snooping-flood-reports) Enable/disable flooding of igmp reports to this interface when igmp-snooping enabled. type: str choices: [disable, enable] more...
- mcast_snooping_flood_traffic (Alias name: mcast-snooping-flood-traffic) Enable/disable flooding of igmp snooping traffic to this interface. type: str choices: [disable, enable] more...
- link_status (Alias name: link-status) Link status. type: str choices: [down, up] more...
- poe_mode_bt_cabable (Alias name: poe-mode-bt-cabable) Poe mode ieee 802. type: int more...
- poe_port_mode (Alias name: poe-port-mode) Configure poe port mode. type: str choices: [ieee802-3af, ieee802-3at, ieee802-3bt] more...
- poe_port_power (Alias name: poe-port-power) Configure poe port power. type: str choices: [normal, perpetual, perpetual-fast] more...
- poe_port_priority (Alias name: poe-port-priority) Configure poe port priority. type: str choices: [critical-priority, high-priority, low-priority, medium-priority] more...
- acl_group (Alias name: acl-group) Acl groups on this port. type: list more...
- dhcp_snoop_option82_override (Alias name: dhcp-snoop-option82-override) Dhcp snoop option82 override. type: list more...
- fortiswitch_acls (Alias name: fortiswitch-acls) Acls on this port. type: list more...
- isl_peer_device_sn (Alias name: isl-peer-device-sn) Isl peer device sn. type: str more...
- authenticated_port (Alias name: authenticated-port) Authenticated port. type: int more...
- encrypted_port (Alias name: encrypted-port) Encrypted port. type: int more...
- ptp_status (Alias name: ptp-status) Enable/disable ptp policy on this fortiswitch port. type: str choices: [disable, enable] more...
- restricted_auth_port (Alias name: restricted-auth-port) Restricted auth port. type: int more...
- allow_arp_monitor (Alias name: allow-arp-monitor) Enable/disable allow arp monitor. type: str choices: [disable, enable] more...
- export_to (Alias name: export-to) Export managed-switch port to a tenant vdom. type: list more...
- export_to_pool (Alias name: export-to-pool) Switch controller export port to pool-list. type: list more...
- fallback_port (Alias name: fallback-port) Lacp fallback port. type: str more...
- fgt_peer_device_name (Alias name: fgt-peer-device-name) Fgt peer device name. type: str more...
- fgt_peer_port_name (Alias name: fgt-peer-port-name) Fgt peer port name. type: str more...
- fiber_port (Alias name: fiber-port) Fiber port. type: int more...
- flags Flags. type: int more...
- fortilink_port (Alias name: fortilink-port) Fortilink port. type: int more...
- isl_local_trunk_name (Alias name: isl-local-trunk-name) Isl local trunk name. type: str more...
- isl_peer_device_name (Alias name: isl-peer-device-name) Isl peer device name. type: str more...
- isl_peer_port_name (Alias name: isl-peer-port-name) Isl peer port name. type: str more...
- poe_capable (Alias name: poe-capable) Poe capable. type: int more...
- port_number (Alias name: port-number) Port number. type: int more...
- port_prefix_type (Alias name: port-prefix-type) Port prefix type. type: int more...
- ptp_policy (Alias name: ptp-policy) Ptp policy configuration. type: list more...
- speed Switch port speed; default and available settings depend on hardware. type: str choices: [auto, 10full, 10half, 100full, 100half, 1000full, 10000full, 1000auto, 40000full, 1000fiber, 10000, 40000, auto-module, 100FX-half, 100FX-full, 100000full, 2500full, 25000full, 50000full, 40000auto, 10000cr, 10000sr, 100000sr4, 100000cr4, 25000cr4, 25000sr4, 5000full, 2500auto, 5000auto, 1000full-fiber, 40000sr4, 40000cr4, 25000cr, 25000sr, 50000cr, 50000sr] more...
- speed_mask (Alias name: speed-mask) Switch port speed mask. type: int more...
- stacking_port (Alias name: stacking-port) Stacking port. type: int more...
- switch_id (Alias name: switch-id) Switch id. type: str more...
- virtual_port (Alias name: virtual-port) Virtualized switch port. type: int more...
- export_tags (Alias name: export-tags) Configure export tag(s) for fortiswitch port when exported to a virtual port pool. type: list more...
- log_mac_event (Alias name: log-mac-event) Enable/disable logging for dynamic mac address events. type: str choices: [disable, enable] more...
- pd_capable (Alias name: pd-capable) Powered device capable. type: int more...
- qnq 802. type: list 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
vars:
ansible_httpapi_use_ssl: true
ansible_httpapi_validate_certs: false
ansible_httpapi_port: 443
tasks:
- name: Managed-switch port list.
fortinet.fortimanager.fmgr_switchcontroller_managedswitch_ports:
# bypass_validation: false
workspace_locking_adom: <value in [global, custom adom including root]>
workspace_locking_timeout: 300
# rc_succeeded: [0, -2, -3, ...]
# rc_failed: [-2, -3, ...]
adom: <your own value>
managed_switch: <your own value>
state: present # <value in [present, absent]>
switchcontroller_managedswitch_ports:
allowed_vlans: <list or string>
allowed_vlans_all: <value in [disable, enable]>
arp_inspection_trust: <value in [untrusted, trusted]>
bundle: <value in [disable, enable]>
description: <string>
dhcp_snoop_option82_trust: <value in [disable, enable]>
dhcp_snooping: <value in [trusted, untrusted]>
discard_mode: <value in [none, all-untagged, all-tagged]>
edge_port: <value in [disable, enable]>
igmp_snooping: <value in [disable, enable]>
igmps_flood_reports: <value in [disable, enable]>
igmps_flood_traffic: <value in [disable, enable]>
lacp_speed: <value in [slow, fast]>
learning_limit: <integer>
lldp_profile: <string>
lldp_status: <value in [disable, rx-only, tx-only, ...]>
loop_guard: <value in [disabled, enabled]>
loop_guard_timeout: <integer>
max_bundle: <integer>
mclag: <value in [disable, enable]>
member_withdrawal_behavior: <value in [forward, block]>
members: <list or string>
min_bundle: <integer>
mode: <value in [static, lacp-passive, lacp-active]>
poe_pre_standard_detection: <value in [disable, enable]>
poe_status: <value in [disable, enable]>
port_name: <string>
port_owner: <string>
port_security_policy: <string>
port_selection_criteria: <value in [src-mac, dst-mac, src-dst-mac, ...]>
qos_policy: <string>
sample_direction: <value in [rx, tx, both]>
sflow_counter_interval: <integer>
sflow_sample_rate: <integer>
sflow_sampler: <value in [disabled, enabled]>
stp_bpdu_guard: <value in [disabled, enabled]>
stp_bpdu_guard_timeout: <integer>
stp_root_guard: <value in [disabled, enabled]>
stp_state: <value in [disabled, enabled]>
type: <value in [physical, trunk]>
untagged_vlans: <list or string>
vlan: <string>
export_to_pool_flag: <integer>
mac_addr: <string>
packet_sample_rate: <integer>
packet_sampler: <value in [disabled, enabled]>
sticky_mac: <value in [disable, enable]>
storm_control_policy: <string>
dot1x_enable: <value in [disable, enable]>
max_miss_heartbeats: <integer>
access_mode: <value in [normal, nac, dynamic, ...]>
ip_source_guard: <value in [disable, enable]>
mclag_icl_port: <integer>
p2p_port: <integer>
aggregator_mode: <value in [bandwidth, count]>
rpvst_port: <value in [disabled, enabled]>
flow_control: <value in [disable, tx, rx, ...]>
media_type: <string>
pause_meter: <integer>
pause_meter_resume: <value in [25%, 50%, 75%]>
trunk_member: <integer>
fec_capable: <integer>
fec_state: <value in [disabled, cl74, cl91, ...]>
matched_dpp_intf_tags: <string>
matched_dpp_policy: <string>
port_policy: <string>
status: <value in [down, up]>
dsl_profile: <string>
flap_duration: <integer>
flap_rate: <integer>
flap_timeout: <integer>
flapguard: <value in [disable, enable]>
interface_tags: <list or string>
poe_max_power: <string>
poe_standard: <string>
igmp_snooping_flood_reports: <value in [disable, enable]>
mcast_snooping_flood_traffic: <value in [disable, enable]>
link_status: <value in [down, up]>
poe_mode_bt_cabable: <integer>
poe_port_mode: <value in [ieee802-3af, ieee802-3at, ieee802-3bt]>
poe_port_power: <value in [normal, perpetual, perpetual-fast]>
poe_port_priority: <value in [critical-priority, high-priority, low-priority, ...]>
acl_group: <list or string>
dhcp_snoop_option82_override:
-
circuit_id: <string>
remote_id: <string>
vlan_name: <string>
fortiswitch_acls: <list or integer>
isl_peer_device_sn: <string>
authenticated_port: <integer>
encrypted_port: <integer>
ptp_status: <value in [disable, enable]>
restricted_auth_port: <integer>
allow_arp_monitor: <value in [disable, enable]>
export_to: <list or string>
export_to_pool: <list or string>
fallback_port: <string>
fgt_peer_device_name: <string>
fgt_peer_port_name: <string>
fiber_port: <integer>
flags: <integer>
fortilink_port: <integer>
isl_local_trunk_name: <string>
isl_peer_device_name: <string>
isl_peer_port_name: <string>
poe_capable: <integer>
port_number: <integer>
port_prefix_type: <integer>
ptp_policy: <list or string>
speed: <value in [auto, 10full, 10half, ...]>
speed_mask: <integer>
stacking_port: <integer>
switch_id: <string>
virtual_port: <integer>
export_tags: <list or string>
log_mac_event: <value in [disable, enable]>
pd_capable: <integer>
qnq: <list or 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.