:source: fortiswitch_system_dhcp_server.py
:orphan:
.. fortiswitch_system_dhcp_server:
fortiswitch_system_dhcp_server -- Configure DHCP servers in Fortinet's FortiSwitch
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
.. versionadded:: 1.0.0
.. contents::
:local:
:depth: 1
Synopsis
--------
- This module is able to configure a FortiSwitch device by allowing the user to set and modify system_dhcp feature and server category. Examples include all parameters and values need to be adjusted to datasources before usage. Tested with FOS v7.0.0
Requirements
------------
The below requirements are needed on the host that executes this module.
- ansible>=2.16
FortiSwitch Version Compatibility
---------------------------------
.. raw:: html
| Supported Version Ranges |
| fortiswitch_system_dhcp_server |
v7.0.0 -> 7.4.3 |
Parameters
----------
.. raw:: html
- 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_dhcp_server - Configure DHCP servers. type: dict
- auto_configuration - Enable/disable auto configuration. type: str choices: disable, enable
- conflicted_ip_timeout - Time in seconds to wait after a conflicted IP address is removed from the DHCP range before it can be reused. type: int
- default_gateway - Default gateway IP address assigned by the DHCP server. type: str
- dns_server1 - DNS server 1. type: str
- dns_server2 - DNS server 2. type: str
- dns_server3 - DNS server 3. type: str
- dns_service - Options for assigning DNS servers to DHCP clients. type: str choices: local, default, specify
- domain - Domain name suffix for the IP addresses that the DHCP server assigns to clients. type: str
- exclude_range - Exclude one or more ranges of IP addresses from being assigned to clients. type: list
- end_ip - End of IP range. type: str
- id - ID. type: int
- start_ip - Start of IP range. type: str
- filename - Name of the boot file on the TFTP server. type: str
- id - ID. type: int required: true
- interface - DHCP server can assign IP configurations to clients connected to this interface. type: str
- ip_mode - Method used to assign client IP. type: str choices: range, usrgrp
- ip_range - DHCP IP range configuration. type: list
- end_ip - End of IP range. type: str
- id - ID. type: int
- start_ip - Start of IP range. type: str
- lease_time - Lease time in seconds, 0 means unlimited. type: int
- netmask - Netmask assigned by the DHCP server. type: str
- next_server - IP address of a server (for example, a TFTP sever) that DHCP clients can download a boot file from. type: str
- ntp_server1 - NTP server 1. type: str
- ntp_server2 - NTP server 2. type: str
- ntp_server3 - NTP server 3. type: str
- ntp_service - Options for assigning Network Time Protocol (NTP) servers to DHCP clients. type: str choices: local, default, specify
- options - DHCP options. type: list
- code - DHCP option code. type: int
- id - ID. type: int
- ip - DHCP option IPs. type: str
- type - DHCP option type. type: str choices: hex, string, ip, fqdn
- value - DHCP option value. type: str
- reserved_address - Options for the DHCP server to assign IP settings to specific MAC addresses. type: list
- action - Options for the DHCP server to configure the client with the reserved MAC address. type: str choices: assign, block, reserved
- circuit_id - Option 82 circuit-ID of the client that will get the reserved IP address. type: str
- circuit_id_type - DHCP option type. type: str choices: hex, string
- description - Description. type: str
- id - ID. type: int
- ip - IP address to be reserved for the MAC address. type: str
- mac - MAC address of the client that will get the reserved IP address. type: str
- remote_id - Option 82 remote-ID of the client that will get the reserved IP address. type: str
- remote_id_type - DHCP option type. type: str choices: hex, string
- type - DHCP reserved-address type. type: str choices: mac, option82
- server_type - DHCP server can be a normal DHCP server or an IPsec DHCP server. type: str choices: regular
- status - Enable/disable this DHCP configuration. type: str choices: disable, enable
- tftp_server - One or more hostnames or IP addresses of the TFTP servers in quotes separated by spaces. type: list
- tftp_server - TFTP server. type: str
- timezone - Select the time zone to be assigned to DHCP clients. type: str choices: 01, 02, 03, 04, 05, 81, 06, 07, 08, 09, 10, 11, 12, 13, 74, 14, 77, 15, 87, 16, 17, 18, 19, 20, 75, 21, 22, 23, 24, 80, 79, 25, 26, 27, 28, 78, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 83, 84, 40, 85, 41, 42, 43, 39, 44, 46, 47, 51, 48, 45, 49, 50, 52, 53, 54, 55, 56, 57, 58, 59, 60, 62, 63, 61, 64, 65, 66, 67, 68, 69, 70, 71, 72, 00, 82, 73, 86, 76, 88, 89, 90, 91, 92
- timezone_option - Options for the DHCP server to set the client"s time zone. type: str choices: disable, default, specify
- vci_match - Enable/disable vendor class identifier (VCI) matching. When enabled only DHCP requests with a matching VCI are served. type: str choices: disable, enable
- vci_string - One or more VCI strings in quotes separated by spaces. type: list
- vci_string - VCI strings. type: str
- wifi_ac1 - WiFi Access Controller 1 IP address (DHCP option 138, RFC 5417). type: str
- wifi_ac2 - WiFi Access Controller 2 IP address (DHCP option 138, RFC 5417). type: str
- wifi_ac3 - WiFi Access Controller 3 IP address (DHCP option 138, RFC 5417). type: str
- wins_server1 - WINS server 1. type: str
- wins_server2 - WINS server 2. type: str
Examples
--------
.. code-block:: yaml+jinja
- name: Configure DHCP servers.
fortinet.fortiswitch.fortiswitch_system_dhcp_server:
state: "present"
system_dhcp_server:
auto_configuration: "disable"
conflicted_ip_timeout: "4320000"
default_gateway: ""
dns_server1: ""
dns_server2: ""
dns_server3: ""
dns_service: "local"
domain: ""
exclude_range:
-
end_ip: ""
id: "13"
start_ip: ""
filename: ""
id: "16"
interface: " (source system.interface.name)"
ip_mode: "range"
ip_range:
-
end_ip: ""
id: "21"
start_ip: ""
lease_time: "23"
netmask: ""
next_server: ""
ntp_server1: ""
ntp_server2: ""
ntp_server3: ""
ntp_service: "local"
options:
-
code: "127"
id: "32"
ip: ""
type: "hex"
value: ""
reserved_address:
-
action: "assign"
circuit_id: ""
circuit_id_type: "hex"
description: ""
id: "41"
ip: ""
mac: ""
remote_id: ""
remote_id_type: "hex"
type: "mac"
server_type: "regular"
status: "disable"
tftp_server:
-
tftp_server: ""
timezone: "01"
timezone_option: "disable"
vci_match: "disable"
vci_string:
-
vci_string: ""
wifi_ac1: ""
wifi_ac2: ""
wifi_ac3: ""
wins_server1: ""
wins_server2: ""
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:
.. raw:: html
- 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
Status
------
- This module is not guaranteed to have a backwards compatible interface.
Authors
-------
- Link Zheng (@chillancezen)
- Jie Xue (@JieX19)
- Hongbin Lu (@fgtdev-hblu)
- Frank Shen (@frankshen01)
- Miguel Angel Munoz (@mamunozgonzalez)
.. hint::
If you notice any issues in this documentation, feel free to create a pull request to improve it.