lix_fortinet.fortios.fortios_switch_controller_lldp_profile (102.2.120) — module

Configure FortiSwitch LLDP profiles in Fortinet's FortiOS and FortiGate.

| "added in version" 2.0.0 of lix_fortinet.fortios"

Authors: Link Zheng (@chillancezen), Jie Xue (@JieX19), Hongbin Lu (@fgtdev-hblu), Frank Shen (@frankshen01), Miguel Angel Munoz (@mamunozgonzalez), Nicolas Thomas (@thomnico)

preview | supported by community

Install collection

Install with ansible-galaxy collection install lix_fortinet.fortios:==102.2.120


Add to requirements.yml

  collections:
    - name: lix_fortinet.fortios
      version: 102.2.120

Description

This module is able to configure a FortiGate or FortiOS (FOS) device by allowing the user to set and modify switch_controller feature and lldp_profile category. Examples include all parameters and values need to be adjusted to datasources before usage. Tested with FOS v6.0.0


Requirements

Usage examples

  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- 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 LLDP profiles.
    fortios_switch_controller_lldp_profile:
      vdom:  "{{ vdom }}"
      state: "present"
      access_token: "<your_own_value>"
      switch_controller_lldp_profile:
        tlvs_802dot1: "port-vlan-id"
        tlvs_802dot3: "max-frame-size"
        auto_isl: "disable"
        auto_isl_hello_timer: "3"
        auto_isl_port_group: "0"
        auto_isl_receive_timeout: "60"
        auto_mclag_icl: "disable"
        custom_tlvs:
         -
            information_string: "<your_own_value>"
            name: "default_name_12"
            oui: "<your_own_value>"
            subtype: "0"
        med_location_service:
         -
            name: "default_name_16"
            status: "disable"
            sys_location_id: "<your_own_value> (source switch-controller.location.name)"
        med_network_policy:
         -
            assign_vlan: "disable"
            dscp: "0"
            name: "default_name_22"
            priority: "0"
            status: "disable"
            vlan: "2047"
            vlan_intf: "<your_own_value> (source system.interface.name)"
        med_tlvs: "inventory-management"
        name: "default_name_28"

Inputs

    
vdom:
    default: root
    description:
    - 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.
    type: str

state:
    choices:
    - present
    - absent
    description:
    - Indicates whether to create or remove the object.
    required: true
    type: str

enable_log:
    default: false
    description:
    - Enable/Disable logging for task.
    required: false
    type: bool

member_path:
    description:
    - 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.
    type: str

access_token:
    description:
    - Token-based authentication. Generated from GUI of Fortigate.
    required: false
    type: str

member_state:
    choices:
    - present
    - absent
    description:
    - Add or delete a member under specified attribute path.
    - When member_state is specified, the state option is ignored.
    type: str

switch_controller_lldp_profile:
    default: null
    description:
    - Configure FortiSwitch LLDP profiles.
    suboptions:
      auto_isl:
        choices:
        - disable
        - enable
        description:
        - Enable/disable auto inter-switch LAG.
        type: str
      auto_isl_hello_timer:
        description:
        - Auto inter-switch LAG hello timer duration (1 - 30 sec).
        type: int
      auto_isl_port_group:
        description:
        - Auto inter-switch LAG port group ID (0 - 9).
        type: int
      auto_isl_receive_timeout:
        description:
        - Auto inter-switch LAG timeout if no response is received (3 - 90 sec).
        type: int
      auto_mclag_icl:
        choices:
        - disable
        - enable
        description:
        - Enable/disable MCLAG inter chassis link.
        type: str
      custom_tlvs:
        description:
        - Configuration method to edit custom TLV entries.
        elements: dict
        suboptions:
          information_string:
            description:
            - Organizationally defined information string (0 - 507 hexadecimal bytes).
            type: str
          name:
            description:
            - TLV name (not sent).
            type: str
          oui:
            description:
            - Organizationally unique identifier (OUI), a 3-byte hexadecimal number, for
              this TLV.
            type: str
          subtype:
            description:
            - Organizationally defined subtype (0 - 255).
            type: int
        type: list
      med_location_service:
        description:
        - Configuration method to edit Media Endpoint Discovery (MED) location service
          type-length-value (TLV) categories.
        elements: dict
        suboptions:
          name:
            description:
            - Location service type name.
            type: str
          status:
            choices:
            - disable
            - enable
            description:
            - Enable or disable this TLV.
            type: str
          sys_location_id:
            description:
            - Location service ID. Source switch-controller.location.name.
            type: str
        type: list
      med_network_policy:
        description:
        - Configuration method to edit Media Endpoint Discovery (MED) network policy type-length-value
          (TLV) categories.
        elements: dict
        suboptions:
          assign_vlan:
            choices:
            - disable
            - enable
            description:
            - Enable/disable VLAN assignment when this profile is applied on managed FortiSwitch
              port.
            type: str
          dscp:
            description:
            - Advertised Differentiated Services Code Point (DSCP) value, a packet header
              value indicating the level of service requested for traffic, such as high
              priority or best effort delivery.
            type: int
          name:
            description:
            - Policy type name.
            type: str
          priority:
            description:
            - Advertised Layer 2 priority (0 - 7; from lowest to highest priority).
            type: int
          status:
            choices:
            - disable
            - enable
            description:
            - Enable or disable this TLV.
            type: str
          vlan:
            description:
            - ID of VLAN to advertise, if configured on port (0 - 4094, 0 = priority tag).
            type: int
          vlan_intf:
            description:
            - VLAN interface to advertise; if configured on port. Source system.interface.name.
            type: str
        type: list
      med_tlvs:
        choices:
        - inventory-management
        - network-policy
        - power-management
        - location-identification
        description:
        - Transmitted LLDP-MED TLVs (type-length-value descriptions).
        elements: str
        type: list
      name:
        description:
        - Profile name.
        required: true
        type: str
      tlvs_802dot1:
        choices:
        - port-vlan-id
        description:
        - Transmitted IEEE 802.1 TLVs.
        elements: str
        type: list
      tlvs_802dot3:
        choices:
        - max-frame-size
        - power-negotiation
        description:
        - Transmitted IEEE 802.3 TLVs.
        elements: str
        type: list
    type: dict

Outputs

build:
  description: Build number of the fortigate image
  returned: always
  sample: '1547'
  type: str
http_method:
  description: Last method used to provision the content into FortiGate
  returned: always
  sample: PUT
  type: str
http_status:
  description: Last result given by FortiGate on last operation applied
  returned: always
  sample: '200'
  type: str
mkey:
  description: Master key (id) used in the last call to FortiGate
  returned: success
  sample: id
  type: str
name:
  description: Name of the table used to fulfill the request
  returned: always
  sample: urlfilter
  type: str
path:
  description: Path of the table used to fulfill the request
  returned: always
  sample: webfilter
  type: str
revision:
  description: Internal revision number
  returned: always
  sample: 17.0.2.10658
  type: str
serial:
  description: Serial number of the unit
  returned: always
  sample: FGVMEVYYQT3AB5352
  type: str
status:
  description: Indication of the operation's result
  returned: always
  sample: success
  type: str
vdom:
  description: Virtual domain used
  returned: always
  sample: root
  type: str
version:
  description: Version of the FortiGate
  returned: always
  sample: v5.6.3
  type: str