fortinet.fortimanager.fmgr_fsp_vlan_dynamicmapping_dhcpserver (2.4.0) — module

Configure DHCP servers.

| "added in version" 2.0.0 of fortinet.fortimanager"

Authors: Xinwei Du (@dux-fortinet), Xing Li (@lix-fortinet), Jie Xue (@JieX19), Link Zheng (@chillancezen), Frank Shen (@fshen01), Hongbin Lu (@fgtdev-hblu)

preview | supported by community

Install collection

Install with ansible-galaxy collection install fortinet.fortimanager:==2.4.0


Add to requirements.yml

  collections:
    - name: fortinet.fortimanager
      version: 2.4.0

Description

This module is able to configure a FortiManager device.

Examples include all parameters and values which need to be adjusted to data sources before usage.

Usage examples

  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- 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: Configure DHCP servers.
      fortinet.fortimanager.fmgr_fsp_vlan_dynamicmapping_dhcpserver:
        # 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>
        vlan: <your own value>
        dynamic_mapping: <your own value>
        fsp_vlan_dynamicmapping_dhcpserver:
          auto_configuration: <value in [disable, enable]>
          conflicted_ip_timeout: <integer>
          ddns_auth: <value in [disable, tsig]>
          ddns_key: <list or string>
          ddns_keyname: <string>
          ddns_server_ip: <string>
          ddns_ttl: <integer>
          ddns_update: <value in [disable, enable]>
          ddns_update_override: <value in [disable, enable]>
          ddns_zone: <string>
          default_gateway: <string>
          dns_server1: <string>
          dns_server2: <string>
          dns_server3: <string>
          dns_service: <value in [default, specify, local]>
          domain: <string>
          enable: <value in [disable, enable]>
          exclude_range:
            -
              end_ip: <string>
              id: <integer>
              start_ip: <string>
              vci_match: <value in [disable, enable]>
              vci_string: <list or string>
              lease_time: <integer>
              uci_match: <value in [disable, enable]>
              uci_string: <list or string>
          filename: <string>
          forticlient_on_net_status: <value in [disable, enable]>
          id: <integer>
          interface: <string>
          ip_mode: <value in [range, usrgrp]>
          ip_range:
            -
              end_ip: <string>
              id: <integer>
              start_ip: <string>
              vci_match: <value in [disable, enable]>
              vci_string: <list or string>
              lease_time: <integer>
              uci_match: <value in [disable, enable]>
              uci_string: <list or string>
          ipsec_lease_hold: <integer>
          lease_time: <integer>
          mac_acl_default_action: <value in [assign, block]>
          netmask: <string>
          next_server: <string>
          ntp_server1: <string>
          ntp_server2: <string>
          ntp_server3: <string>
          ntp_service: <value in [default, specify, local]>
          option1: <list or string>
          option2: <list or string>
          option3: <list or string>
          option4: <string>
          option5: <string>
          option6: <string>
          options:
            -
              code: <integer>
              id: <integer>
              ip: <list or string>
              type: <value in [hex, string, ip, ...]>
              value: <string>
              vci_match: <value in [disable, enable]>
              vci_string: <list or string>
              uci_match: <value in [disable, enable]>
              uci_string: <list or string>
          reserved_address:
            -
              action: <value in [assign, block, reserved]>
              circuit_id: <string>
              circuit_id_type: <value in [hex, string]>
              description: <string>
              id: <integer>
              ip: <string>
              mac: <string>
              remote_id: <string>
              remote_id_type: <value in [hex, string]>
              type: <value in [mac, option82]>
          server_type: <value in [regular, ipsec]>
          status: <value in [disable, enable]>
          tftp_server: <list or string>
          timezone: <value in [00, 01, 02, ...]>
          timezone_option: <value in [disable, default, specify]>
          vci_match: <value in [disable, enable]>
          vci_string: <list or string>
          wifi_ac1: <string>
          wifi_ac2: <string>
          wifi_ac3: <string>
          wins_server1: <string>
          wins_server2: <string>
          dns_server4: <string>
          wifi_ac_service: <value in [specify, local]>
          auto_managed_status: <value in [disable, enable]>
          dhcp_settings_from_fortiipam: <value in [disable, enable]>
          relay_agent: <string>
          shared_subnet: <value in [disable, enable]>

Inputs

    
adom:
    description: The parameter (adom) in requested url.
    required: true
    type: str

vlan:
    description: The parameter (vlan) in requested url.
    required: true
    type: str

rc_failed:
    description: The rc codes list with which the conditions to fail will be overriden.
    elements: int
    type: list

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

access_token:
    description: The token to access FortiManager without using username and password.
    type: str

rc_succeeded:
    description: The rc codes list with which the conditions to succeed will be overriden.
    elements: int
    type: list

dynamic_mapping:
    description: The parameter (dynamic_mapping) in requested url.
    required: true
    type: str

proposed_method:
    choices:
    - update
    - set
    - add
    description: The overridden method for the underlying Json RPC request.
    type: str

bypass_validation:
    default: false
    description: Only set to True when module schema diffs with FortiManager API structure,
      module continues to execute without validating parameters.
    type: bool

workspace_locking_adom:
    description: The adom to lock for FortiManager running in workspace mode, the value
      can be global and others including root.
    type: str

forticloud_access_token:
    description: Authenticate Ansible client with forticloud API access token.
    type: str

workspace_locking_timeout:
    default: 300
    description: The maximum time in seconds to wait for other user to release the workspace
      lock.
    type: int

fsp_vlan_dynamicmapping_dhcpserver:
    description: The top level parameters set.
    required: false
    suboptions:
      auto-configuration:
        choices:
        - disable
        - enable
        description: Deprecated, please rename it to auto_configuration.
        type: str
      auto-managed-status:
        choices:
        - disable
        - enable
        description: Deprecated, please rename it to auto_managed_status.
        type: str
      conflicted-ip-timeout:
        description: Deprecated, please rename it to conflicted_ip_timeout.
        type: int
      ddns-auth:
        choices:
        - disable
        - tsig
        description: Deprecated, please rename it to ddns_auth.
        type: str
      ddns-key:
        description: (list or str) Deprecated, please rename it to ddns_key.
        type: raw
      ddns-keyname:
        description: Deprecated, please rename it to ddns_keyname.
        type: str
      ddns-server-ip:
        description: Deprecated, please rename it to ddns_server_ip.
        type: str
      ddns-ttl:
        description: Deprecated, please rename it to ddns_ttl.
        type: int
      ddns-update:
        choices:
        - disable
        - enable
        description: Deprecated, please rename it to ddns_update.
        type: str
      ddns-update-override:
        choices:
        - disable
        - enable
        description: Deprecated, please rename it to ddns_update_override.
        type: str
      ddns-zone:
        description: Deprecated, please rename it to ddns_zone.
        type: str
      default-gateway:
        description: Deprecated, please rename it to default_gateway.
        type: str
      dhcp-settings-from-fortiipam:
        choices:
        - disable
        - enable
        description: Deprecated, please rename it to dhcp_settings_from_fortiipam.
        type: str
      dns-server1:
        description: Deprecated, please rename it to dns_server1.
        type: str
      dns-server2:
        description: Deprecated, please rename it to dns_server2.
        type: str
      dns-server3:
        description: Deprecated, please rename it to dns_server3.
        type: str
      dns-server4:
        description: Deprecated, please rename it to dns_server4.
        type: str
      dns-service:
        choices:
        - default
        - specify
        - local
        description: Deprecated, please rename it to dns_service.
        type: str
      domain:
        description: No description.
        type: str
      enable:
        choices:
        - disable
        - enable
        description: No description.
        type: str
      exclude-range:
        description: Deprecated, please rename it to exclude_range.
        elements: dict
        suboptions:
          end-ip:
            description: Deprecated, please rename it to end_ip.
            type: str
          id:
            description: No description.
            type: int
          lease-time:
            description: Deprecated, please rename it to lease_time. Lease time in seconds,
              0 means default lease time.
            type: int
          start-ip:
            description: Deprecated, please rename it to start_ip.
            type: str
          uci-match:
            choices:
            - disable
            - enable
            description: Deprecated, please rename it to uci_match. Enable/disable user
              class identifier
            type: str
          uci-string:
            description: (list) Deprecated, please rename it to uci_string.
            type: raw
          vci-match:
            choices:
            - disable
            - enable
            description: Deprecated, please rename it to vci_match. Enable/disable vendor
              class identifier
            type: str
          vci-string:
            description: (list) Deprecated, please rename it to vci_string.
            type: raw
        type: list
      filename:
        description: No description.
        type: str
      forticlient-on-net-status:
        choices:
        - disable
        - enable
        description: Deprecated, please rename it to forticlient_on_net_status.
        type: str
      id:
        description: No description.
        type: int
      interface:
        description: No description.
        type: str
      ip-mode:
        choices:
        - range
        - usrgrp
        description: Deprecated, please rename it to ip_mode.
        type: str
      ip-range:
        description: Deprecated, please rename it to ip_range.
        elements: dict
        suboptions:
          end-ip:
            description: Deprecated, please rename it to end_ip.
            type: str
          id:
            description: No description.
            type: int
          lease-time:
            description: Deprecated, please rename it to lease_time. Lease time in seconds,
              0 means default lease time.
            type: int
          start-ip:
            description: Deprecated, please rename it to start_ip.
            type: str
          uci-match:
            choices:
            - disable
            - enable
            description: Deprecated, please rename it to uci_match. Enable/disable user
              class identifier
            type: str
          uci-string:
            description: (list) Deprecated, please rename it to uci_string.
            type: raw
          vci-match:
            choices:
            - disable
            - enable
            description: Deprecated, please rename it to vci_match. Enable/disable vendor
              class identifier
            type: str
          vci-string:
            description: (list) Deprecated, please rename it to vci_string.
            type: raw
        type: list
      ipsec-lease-hold:
        description: Deprecated, please rename it to ipsec_lease_hold.
        type: int
      lease-time:
        description: Deprecated, please rename it to lease_time.
        type: int
      mac-acl-default-action:
        choices:
        - assign
        - block
        description: Deprecated, please rename it to mac_acl_default_action.
        type: str
      netmask:
        description: No description.
        type: str
      next-server:
        description: Deprecated, please rename it to next_server.
        type: str
      ntp-server1:
        description: Deprecated, please rename it to ntp_server1.
        type: str
      ntp-server2:
        description: Deprecated, please rename it to ntp_server2.
        type: str
      ntp-server3:
        description: Deprecated, please rename it to ntp_server3.
        type: str
      ntp-service:
        choices:
        - default
        - specify
        - local
        description: Deprecated, please rename it to ntp_service.
        type: str
      option1:
        description: (list) No description.
        type: raw
      option2:
        description: (list) No description.
        type: raw
      option3:
        description: (list) No description.
        type: raw
      option4:
        description: No description.
        type: str
      option5:
        description: No description.
        type: str
      option6:
        description: No description.
        type: str
      options:
        description: No description.
        elements: dict
        suboptions:
          code:
            description: No description.
            type: int
          id:
            description: No description.
            type: int
          ip:
            description: (list) No description.
            type: raw
          type:
            choices:
            - hex
            - string
            - ip
            - fqdn
            description: No description.
            type: str
          uci-match:
            choices:
            - disable
            - enable
            description: Deprecated, please rename it to uci_match. Enable/disable user
              class identifier
            type: str
          uci-string:
            description: (list) Deprecated, please rename it to uci_string.
            type: raw
          value:
            description: No description.
            type: str
          vci-match:
            choices:
            - disable
            - enable
            description: Deprecated, please rename it to vci_match. Enable/disable vendor
              class identifier
            type: str
          vci-string:
            description: (list) Deprecated, please rename it to vci_string.
            type: raw
        type: list
      relay-agent:
        description: Deprecated, please rename it to relay_agent. Relay agent IP.
        type: str
      reserved-address:
        description: Deprecated, please rename it to reserved_address.
        elements: dict
        suboptions:
          action:
            choices:
            - assign
            - block
            - reserved
            description: No description.
            type: str
          circuit-id:
            description: Deprecated, please rename it to circuit_id.
            type: str
          circuit-id-type:
            choices:
            - hex
            - string
            description: Deprecated, please rename it to circuit_id_type.
            type: str
          description:
            description: No description.
            type: str
          id:
            description: No description.
            type: int
          ip:
            description: No description.
            type: str
          mac:
            description: No description.
            type: str
          remote-id:
            description: Deprecated, please rename it to remote_id.
            type: str
          remote-id-type:
            choices:
            - hex
            - string
            description: Deprecated, please rename it to remote_id_type.
            type: str
          type:
            choices:
            - mac
            - option82
            description: No description.
            type: str
        type: list
      server-type:
        choices:
        - regular
        - ipsec
        description: Deprecated, please rename it to server_type.
        type: str
      shared-subnet:
        choices:
        - disable
        - enable
        description: Deprecated, please rename it to shared_subnet. Enable/disable shared
          subnet.
        type: str
      status:
        choices:
        - disable
        - enable
        description: No description.
        type: str
      tftp-server:
        description: (list) Deprecated, please rename it to tftp_server.
        type: raw
      timezone:
        choices:
        - '00'
        - '01'
        - '02'
        - '03'
        - '04'
        - '05'
        - '06'
        - '07'
        - 08
        - 09
        - '10'
        - '11'
        - '12'
        - '13'
        - '14'
        - '15'
        - '16'
        - '17'
        - '18'
        - '19'
        - '20'
        - '21'
        - '22'
        - '23'
        - '24'
        - '25'
        - '26'
        - '27'
        - '28'
        - '29'
        - '30'
        - '31'
        - '32'
        - '33'
        - '34'
        - '35'
        - '36'
        - '37'
        - '38'
        - '39'
        - '40'
        - '41'
        - '42'
        - '43'
        - '44'
        - '45'
        - '46'
        - '47'
        - '48'
        - '49'
        - '50'
        - '51'
        - '52'
        - '53'
        - '54'
        - '55'
        - '56'
        - '57'
        - '58'
        - '59'
        - '60'
        - '61'
        - '62'
        - '63'
        - '64'
        - '65'
        - '66'
        - '67'
        - '68'
        - '69'
        - '70'
        - '71'
        - '72'
        - '73'
        - '74'
        - '75'
        - '76'
        - '77'
        - '78'
        - '79'
        - '80'
        - '81'
        - '82'
        - '83'
        - '84'
        - '85'
        - '86'
        - '87'
        description: No description.
        type: str
      timezone-option:
        choices:
        - disable
        - default
        - specify
        description: Deprecated, please rename it to timezone_option.
        type: str
      vci-match:
        choices:
        - disable
        - enable
        description: Deprecated, please rename it to vci_match.
        type: str
      vci-string:
        description: (list) Deprecated, please rename it to vci_string.
        type: raw
      wifi-ac-service:
        choices:
        - specify
        - local
        description: Deprecated, please rename it to wifi_ac_service.
        type: str
      wifi-ac1:
        description: Deprecated, please rename it to wifi_ac1.
        type: str
      wifi-ac2:
        description: Deprecated, please rename it to wifi_ac2.
        type: str
      wifi-ac3:
        description: Deprecated, please rename it to wifi_ac3.
        type: str
      wins-server1:
        description: Deprecated, please rename it to wins_server1.
        type: str
      wins-server2:
        description: Deprecated, please rename it to wins_server2.
        type: str
    type: dict

Outputs

meta:
  contains:
    request_url:
      description: The full url requested.
      returned: always
      sample: /sys/login/user
      type: str
    response_code:
      description: The status of api request.
      returned: always
      sample: 0
      type: int
    response_data:
      description: The api response.
      returned: always
      type: list
    response_message:
      description: The descriptive message of the api response.
      returned: always
      sample: OK.
      type: str
    system_information:
      description: The information of the target system.
      returned: always
      type: dict
  description: The result of the request.
  returned: always
  type: dict
rc:
  description: The status the request.
  returned: always
  sample: 0
  type: int
version_check_warning:
  description: Warning if the parameters used in the playbook are not supported by
    the current FortiManager version.
  returned: complex
  type: list