fortiswitch_system_location – Configure Location table in Fortinet’s FortiSwitch

New in version 1.0.0.


  • This module is able to configure a FortiSwitch device by allowing the user to set and modify system feature and location category. Examples include all parameters and values need to be adjusted to datasources before usage. Tested with FOS v7.0.0


The below requirements are needed on the host that executes this module.

  • ansible>=2.11

FortiSW Version Compatibility

v7.0.0 v7.0.1 v7.0.2 v7.0.3
fortiswitch_system_location yes yes yes yes


  • enable_log - Enable/Disable logging for task. type: bool required: false default: False
  • member_path - Member attribute path to operate on. type: str
  • member_state - Add or delete a member under specified attribute path. type: str choices: present, absent
  • state - Indicates whether to create or remove the object. type: str required: true choices: present, absent
  • system_location - Configure Location table. type: dict
    • address_civic - Configure Location Civic Address. type: dict
      • additional - Additional location information. type: str
      • additional_code - Additional code. type: str
      • block - Neighborhood or block. type: str
      • branch_road - Branch road name. type: str
      • building - Building (structure). type: str
      • city - City, township, or shi (JP). type: str
      • city_division - City division, borough, city district, ward, or chou (JP). type: str
      • country - The two-letter ISO 3166 country code in capital ASCII letters eg. US, CA, DK, DE. type: str
      • country_subdivision - National subdivisions (state, canton, region, province, or prefecture). type: str
      • county - County, parish, gun (JP), or district (IN). type: str
      • direction - Leading street direction. type: str
      • floor - Floor. type: str
      • landmark - Landmark or vanity address. type: str
      • language - Language. type: str
      • name - Name (residence and office occupant). type: str
      • number - House number. type: str
      • number_suffix - House number suffix. type: str
      • place_type - Placetype. type: str
      • post_office_box - Post office box (P.O. box). type: str
      • postal_community - Postal community name. type: str
      • primary_road - Primary road name. type: str
      • road_section - Road section. type: str
      • room - Room number. type: str
      • script - Script used to present the address information. type: str
      • seat - Seat number. type: str
      • street - Street. type: str
      • street_name_post_mod - Street name post modifier. type: str
      • street_name_pre_mod - Street name pre modifier. type: str
      • street_suffix - Street suffix. type: str
      • sub_branch_road - Sub branch road name. type: str
      • trailing_str_suffix - Trailing street suffix. type: str
      • unit - Unit (apartment, suite). type: str
      • zip - Postal/zip code. type: str
    • coordinates - Configure Location GPS Coordinates. type: dict
      • altitude - +/- Floating point no. eg. 117.47. type: str
      • altitude_unit - m ( meters), f ( floors). type: str choices: m, f
      • datum - WGS84, NAD83, NAD83/MLLW . type: str choices: WGS84, NAD83, NAD83/MLLW
      • latitude - Floating point start with ( +/- ) or end with ( N or S ) eg. +/-16.67 or 16.67N. type: str
      • longitude - Floating point start with ( +/- ) or end with ( E or W ) eg. +/-26.789 or 26.789E. type: str
    • elin_number - Configure Location ELIN Number. type: dict
      • elin_number - Configure Elin Callback Number, 10 to 20 bytes numerial string. type: str
    • name - Unique Location Item Name. type: str required: true


- hosts: fortiswitch01
    - fortinet.fortiswitch
  connection: httpapi
   ansible_httpapi_use_ssl: yes
   ansible_httpapi_validate_certs: no
   ansible_httpapi_port: 443
  - name: Configure Location table.
      state: "present"
            additional: "<your_own_value>"
            additional_code: "<your_own_value>"
            block: "<your_own_value>"
            branch_road: "<your_own_value>"
            building: "<your_own_value>"
            city: "<your_own_value>"
            city_division: "<your_own_value>"
            country: "<your_own_value>"
            country_subdivision: "<your_own_value>"
            county: "<your_own_value>"
            direction: "<your_own_value>"
            floor: "<your_own_value>"
            landmark: "<your_own_value>"
            language: "<your_own_value>"
            name: "default_name_18"
            number: "<your_own_value>"
            number_suffix: "<your_own_value>"
            place_type: "<your_own_value>"
            post_office_box: "<your_own_value>"
            postal_community: "<your_own_value>"
            primary_road: "<your_own_value>"
            road_section: "<your_own_value>"
            room: "<your_own_value>"
            script: "<your_own_value>"
            seat: "<your_own_value>"
            street: "<your_own_value>"
            street_name_post_mod: "<your_own_value>"
            street_name_pre_mod: "<your_own_value>"
            street_suffix: "<your_own_value>"
            sub_branch_road: "<your_own_value>"
            trailing_str_suffix: "<your_own_value>"
            unit: "<your_own_value>"
            zip: "<your_own_value>"
            altitude: "<your_own_value>"
            altitude_unit: "m"
            datum: "WGS84"
            latitude: "<your_own_value>"
            longitude: "<your_own_value>"
            elin_number: "<your_own_value>"
        name: "default_name_45"

Return Values

Common return values are documented:, the following are the fields unique to this module:

  • build - Build number of the fortiSwitch image returned: always type: str sample: 1547
  • http_method - Last method used to provision the content into FortiSwitch returned: always type: str sample: PUT
  • http_status - Last result given by FortiSwitch on last operation applied returned: always type: str sample: 200
  • mkey - Master key (id) used in the last call to FortiSwitch returned: success type: str sample: id
  • name - Name of the table used to fulfill the request returned: always type: str sample: urlfilter
  • path - Path of the table used to fulfill the request returned: always type: str sample: webfilter
  • serial - Serial number of the unit returned: always type: str sample: FS1D243Z13000122
  • status - Indication of the operation's result returned: always type: str sample: success
  • version - Version of the FortiSwitch returned: always type: str sample: v7.0.0


  • This module is not guaranteed to have a backwards compatible interface.


  • Link Zheng (@chillancezen)
  • Jie Xue (@JieX19)
  • Hongbin Lu (@fgtdev-hblu)
  • Frank Shen (@frankshen01)
  • Miguel Angel Munoz (@mamunozgonzalez)


If you notice any issues in this documentation, you can create a pull request to improve it.