fmgr_switchcontroller_managedswitch – Configure FortiSwitch devices that are managed by this FortiGate.¶
New in version 2.10.
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 v6.0.0.
Requirements¶
The below requirements are needed on the host that executes this module.
- ansible>=2.9.0
Parameters¶
- 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
- 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
- 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
- adom - The parameter in requested url type: str required: true
- switchcontroller_managedswitch - Configure FortiSwitch devices that are managed by this FortiGate. type: dict
- _platform - No description for the parameter type: str
- description - Description. type: str
- name - Managed-switch name. type: str
- ports - No description for the parameter type: array
- allowed-vlans - Configure switch port tagged vlans type: str
- allowed-vlans-all - Enable/disable all defined vlans on this port. type: str choices: [disable, enable]
- arp-inspection-trust - Trusted or untrusted dynamic ARP inspection. type: str choices: [untrusted, trusted]
- bundle - Enable/disable Link Aggregation Group (LAG) bundling for non-FortiLink interfaces. type: str choices: [disable, enable]
- description - Description for port. type: str
- dhcp-snoop-option82-trust - Enable/disable allowance of DHCP with option-82 on untrusted interface. type: str choices: [disable, enable]
- dhcp-snooping - Trusted or untrusted DHCP-snooping interface. type: str choices: [trusted, untrusted]
- discard-mode - Configure discard mode for port. type: str choices: [none, all-untagged, all-tagged]
- edge-port - Enable/disable this interface as an edge port, bridging connections between workstations and/or computers. type: str choices: [disable, enable]
- igmp-snooping - Set IGMP snooping mode for the physical port interface. type: str choices: [disable, enable]
- igmps-flood-reports - Enable/disable flooding of IGMP reports to this interface when igmp-snooping enabled. type: str choices: [disable, enable]
- igmps-flood-traffic - Enable/disable flooding of IGMP snooping traffic to this interface. type: str choices: [disable, enable]
- lacp-speed - end Link Aggregation Control Protocol (LACP) messages every 30 seconds (slow) or every second (fast). type: str choices: [slow, fast]
- learning-limit - Limit the number of dynamic MAC addresses on this Port (1 - 128, 0 = no limit, default). type: int
- lldp-profile - LLDP port TLV profile. type: str
- lldp-status - LLDP transmit and receive status. type: str choices: [disable, rx-only, tx-only, tx-rx]
- loop-guard - Enable/disable loop-guard on this interface, an STP optimization used to prevent network loops. type: str choices: [disabled, enabled]
- loop-guard-timeout - Loop-guard timeout (0 - 120 min, default = 45). type: int
- max-bundle - Maximum size of LAG bundle (1 - 24, default = 24) type: int
- mclag - Enable/disable multi-chassis link aggregation (MCLAG). type: str choices: [disable, enable]
- member-withdrawal-behavior - Port behavior after it withdraws because of loss of control packets. type: str choices: [forward, block]
- members - No description for the parameter type: str
- min-bundle - Minimum size of LAG bundle (1 - 24, default = 1) type: int
- mode - LACP mode: ignore and do not send control messages, or negotiate 802. type: str choices: [static, lacp-passive, lacp-active]
- poe-pre-standard-detection - Enable/disable PoE pre-standard detection. type: str choices: [disable, enable]
- poe-status - Enable/disable PoE status. type: str choices: [disable, enable]
- port-name - Switch port name. type: str
- port-owner - Switch port name. type: str
- port-security-policy - Switch controller authentication policy to apply to this managed switch from available options. type: str
- 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]
- qos-policy - Switch controller QoS policy from available options. type: str
- sample-direction - sFlow sample direction. type: str choices: [rx, tx, both]
- sflow-counter-interval - sFlow sampler counter polling interval (1 - 255 sec). type: int
- sflow-sample-rate - sFlow sampler sample rate (0 - 99999 p/sec). type: int
- sflow-sampler - Enable/disable sFlow protocol on this interface. type: str choices: [disabled, enabled]
- stp-bpdu-guard - Enable/disable STP BPDU guard on this interface. type: str choices: [disabled, enabled]
- stp-bpdu-guard-timeout - BPDU Guard disabling protection (0 - 120 min). type: int
- stp-root-guard - Enable/disable STP root guard on this interface. type: str choices: [disabled, enabled]
- stp-state - Enable/disable Spanning Tree Protocol (STP) on this interface. type: str choices: [disabled, enabled]
- type - Interface type: physical or trunk port. type: str choices: [physical, trunk]
- untagged-vlans - Configure switch port untagged vlans type: str
- vlan - Assign switch ports to a VLAN. type: str
- switch-id - Managed-switch id. type: str
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¶
- hosts: fortimanager-inventory
collections:
- fortinet.fortimanager
connection: httpapi
vars:
ansible_httpapi_use_ssl: True
ansible_httpapi_validate_certs: False
ansible_httpapi_port: 443
tasks:
- name: Configure FortiSwitch devices that are managed by this FortiGate.
fmgr_switchcontroller_managedswitch:
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>
state: <value in [present, absent]>
switchcontroller_managedswitch:
_platform: <value of string>
description: <value of string>
name: <value of string>
ports:
-
allowed-vlans: <value of string>
allowed-vlans-all: <value in [disable, enable]>
arp-inspection-trust: <value in [untrusted, trusted]>
bundle: <value in [disable, enable]>
description: <value of 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: <value of integer>
lldp-profile: <value of string>
lldp-status: <value in [disable, rx-only, tx-only, ...]>
loop-guard: <value in [disabled, enabled]>
loop-guard-timeout: <value of integer>
max-bundle: <value of integer>
mclag: <value in [disable, enable]>
member-withdrawal-behavior: <value in [forward, block]>
members: <value of string>
min-bundle: <value of 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: <value of string>
port-owner: <value of string>
port-security-policy: <value of string>
port-selection-criteria: <value in [src-mac, dst-mac, src-dst-mac, ...]>
qos-policy: <value of string>
sample-direction: <value in [rx, tx, both]>
sflow-counter-interval: <value of integer>
sflow-sample-rate: <value of integer>
sflow-sampler: <value in [disabled, enabled]>
stp-bpdu-guard: <value in [disabled, enabled]>
stp-bpdu-guard-timeout: <value of integer>
stp-root-guard: <value in [disabled, enabled]>
stp-state: <value in [disabled, enabled]>
type: <value in [physical, trunk]>
untagged-vlans: <value of string>
vlan: <value of string>
switch-id: <value of 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:
- 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_message - The descriptive message of the api response returned: always type: str sample: OK
- response_data - The data body of the api response returned: optional type: list or dict