fmgd_switchcontroller_location – Configure FortiSwitch location services.

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
  • 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
  • device - The parameter in requested url type: str required: true
  • vdom - The parameter in requested url type: str required: true
  • switchcontroller_location - Configure FortiSwitch location services. type: dict
    • address_civic (Alias name: address-civic) Address civic. type: dict more...
      • additional Location additional details. type: str more...
      • additional_code (Alias name: additional-code) Location additional code details. type: str more...
      • block Location block details. type: str more...
      • branch_road (Alias name: branch-road) Location branch road details. type: str more...
      • building Location building details. type: str more...
      • city Location city details. type: str more...
      • city_division (Alias name: city-division) Location city division details. type: str more...
      • country The two-letter iso 3166 country code in capital ascii letters eg. type: str more...
      • country_subdivision (Alias name: country-subdivision) National subdivisions (state, canton, region, province, or prefecture). type: str more...
      • county County, parish, gun (jp), or district (in). type: str more...
      • direction Leading street direction. type: str more...
      • floor Floor. type: str more...
      • landmark Landmark or vanity address. type: str more...
      • language Language. type: str more...
      • name Name (residence and office occupant). type: str more...
      • number House number. type: str more...
      • number_suffix (Alias name: number-suffix) House number suffix. type: str more...
      • parent_key (Alias name: parent-key) Parent key. type: str more...
      • place_type (Alias name: place-type) Place type. type: str more...
      • post_office_box (Alias name: post-office-box) Post office box. type: str more...
      • postal_community (Alias name: postal-community) Postal community name. type: str more...
      • primary_road (Alias name: primary-road) Primary road name. type: str more...
      • road_section (Alias name: road-section) Road section. type: str more...
      • room Room number. type: str more...
      • script Script used to present the address information. type: str more...
      • seat Seat number. type: str more...
      • street Street. type: str more...
      • street_name_post_mod (Alias name: street-name-post-mod) Street name post modifier. type: str more...
      • street_name_pre_mod (Alias name: street-name-pre-mod) Street name pre modifier. type: str more...
      • street_suffix (Alias name: street-suffix) Street suffix. type: str more...
      • sub_branch_road (Alias name: sub-branch-road) Sub branch road name. type: str more...
      • trailing_str_suffix (Alias name: trailing-str-suffix) Trailing street suffix. type: str more...
      • unit Unit (apartment, suite). type: str more...
      • zip Postal/zip code. type: str more...
    • coordinates Coordinates. type: dict more...
      • altitude Plus or minus floating point number. type: str more...
      • altitude_unit (Alias name: altitude-unit) Configure the unit for which the altitude is to (m = meters, f = floors of a building). type: str choices: [m, f] more...
      • datum Wgs84, nad83, nad83/mllw. type: str choices: [WGS84, NAD83, NAD83/MLLW] more...
      • latitude Floating point starting with +/- or ending with (n or s). type: str more...
      • longitude Floating point starting with +/- or ending with (n or s). type: str more...
      • parent_key (Alias name: parent-key) Parent key. type: str more...
    • elin_number (Alias name: elin-number) Elin number. type: dict more...
      • elin_num (Alias name: elin-num) Configure elin callback number. type: str more...
      • parent_key (Alias name: parent-key) Parent key. type: str more...
    • name Unique location item name. type: str 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 location services.
      fortinet.fmgdevice.fmgd_switchcontroller_location:
        # 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>
        state: present # <value in [present, absent]>
        switchcontroller_location:
          name: "your value" # Required variable, string
          # address_civic:
          #   additional: <string>
          #   additional_code: <string>
          #   block: <string>
          #   branch_road: <string>
          #   building: <string>
          #   city: <string>
          #   city_division: <string>
          #   country: <string>
          #   country_subdivision: <string>
          #   county: <string>
          #   direction: <string>
          #   floor: <string>
          #   landmark: <string>
          #   language: <string>
          #   name: <string>
          #   number: <string>
          #   number_suffix: <string>
          #   parent_key: <string>
          #   place_type: <string>
          #   post_office_box: <string>
          #   postal_community: <string>
          #   primary_road: <string>
          #   road_section: <string>
          #   room: <string>
          #   script: <string>
          #   seat: <string>
          #   street: <string>
          #   street_name_post_mod: <string>
          #   street_name_pre_mod: <string>
          #   street_suffix: <string>
          #   sub_branch_road: <string>
          #   trailing_str_suffix: <string>
          #   unit: <string>
          #   zip: <string>
          # coordinates:
          #   altitude: <string>
          #   altitude_unit: <value in [m, f]>
          #   datum: <value in [WGS84, NAD83, NAD83/MLLW]>
          #   latitude: <string>
          #   longitude: <string>
          #   parent_key: <string>
          # elin_number:
          #   elin_num: <string>
          #   parent_key: <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.

Authors

  • Xinwei Du (@dux-fortinet)

  • Xing Li (@lix-fortinet)

  • Jie Xue (@JieX19)

  • Link Zheng (@chillancezen)

  • Frank Shen (@fshen01)

  • Hongbin Lu (@fgtdev-hblu)