fortinet.fortios.fortios_system_dhcp_template module – Configure DHCP server templates in Fortinet’s FortiOS and FortiGate.
Note
This module is part of the fortinet.fortios collection (version 2.6.0).
You might already have this collection installed if you are using the ansible package.
It is not included in ansible-core.
To check whether it is installed, run ansible-galaxy collection list.
To install it, use: ansible-galaxy collection install fortinet.fortios.
You need further requirements to be able to use this module,
see Requirements for details.
To use it in a playbook, specify: fortinet.fortios.fortios_system_dhcp_template.
New in fortinet.fortios 2.0.0
Synopsis
This module is able to configure a FortiGate or FortiOS (FOS) device by allowing the user to set and modify system_dhcp feature and template category. Examples include all parameters and values need to be adjusted to datasources before usage. Tested with FOS v6.0.0
Requirements
The below requirements are needed on the host that executes this module.
ansible>=2.16
Parameters
Parameter |
Comments |
|---|---|
Token-based authentication. Generated from GUI of Fortigate. |
|
Enable/Disable logging for task. Choices:
|
|
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. |
|
Add or delete a member under specified attribute path. When member_state is specified, the state option is ignored. Choices:
|
|
Indicates whether to create or remove the object. Choices:
|
|
Configure DHCP server templates. |
|
Enable/disable auto configuration. Choices:
|
|
Time in seconds to wait after a conflicted IP address is removed from the DHCP range before it can be reused. |
|
DDNS authentication mode. Choices:
|
|
DDNS update key (base 64 encoding). |
|
DDNS update key name. |
|
DDNS server IP. |
|
TTL. |
|
Enable/disable DDNS update for DHCP. Choices:
|
|
Enable/disable DDNS update override for DHCP. Choices:
|
|
Zone of your domain name (ex. DDNS.com). |
|
DNS server 1. |
|
DNS server 2. |
|
DNS server 3. |
|
DNS server 4. |
|
Options for assigning DNS servers to DHCP clients. Choices:
|
|
Domain name suffix for the IP addresses that the DHCP server assigns to clients. |
|
Exclude one or more ranges of IP addresses from being assigned to clients. |
|
ID. see <a href=’#notes’>Notes</a>. |
|
Number of IP addresses to include in the range. |
|
Lease time in seconds, 0 means default lease time. |
|
Enable/disable organizationally unique identifier (OUI) matching. When enabled only DHCP requests with a matching OUI are served with this range. Choices:
|
|
One or more OUI strings in quotes separated by spaces (in format of xx:xx:xx). |
|
MAC OUI strings. |
|
Start of IP range. |
|
Enable/disable user class identifier (UCI) matching. When enabled only DHCP requests with a matching UCI are served with this range. Choices:
|
|
One or more UCI strings in quotes separated by spaces. |
|
UCI strings. |
|
Enable/disable vendor class identifier (VCI) matching. When enabled only DHCP requests with a matching VCI are served with this range. Choices:
|
|
One or more VCI strings in quotes separated by spaces. |
|
VCI strings. |
|
Vendor this ip-range will be assigned to. |
|
Enable/disable forced synchronization of configuration objects from the root FortiGate unit to the downstream devices. Configuration conflict check is skipped. Choices:
|
|
Security Fabric global object setting. Choices:
|
|
Source of truth for fabric object. Choices:
|
|
Name of the boot file on the TFTP server. |
|
Enable/disable FortiClient-On-Net service for this DHCP server. Choices:
|
|
DHCP IP range configuration. |
|
ID. see <a href=’#notes’>Notes</a>. |
|
Number of IP addresses to include in the range. |
|
Lease time in seconds, 0 means default lease time. |
|
Enable/disable organizationally unique identifier (OUI) matching. When enabled only DHCP requests with a matching OUI are served with this range. Choices:
|
|
One or more OUI strings in quotes separated by spaces (in format of xx:xx:xx). |
|
MAC OUI strings. |
|
Enable/disable address reservation for use without DHCP. Choices:
|
|
Enable/disable user class identifier (UCI) matching. When enabled only DHCP requests with a matching UCI are served with this range. Choices:
|
|
One or more UCI strings in quotes separated by spaces. |
|
UCI strings. |
|
Enable/disable vendor class identifier (VCI) matching. When enabled only DHCP requests with a matching VCI are served with this range. Choices:
|
|
One or more VCI strings in quotes separated by spaces. |
|
VCI strings. |
|
Vendor this ip-range will be assigned to. |
|
DHCP over IPsec leases expire this many seconds after tunnel down (0 to disable forced-expiry). |
|
Lease time in seconds, 0 means unlimited. |
|
MAC access control default action (allow or block assigning IP settings). Choices:
|
|
DHCP server template name. |
|
IP address of a server, such as a TFTP server, from which DHCP clients can download a boot file. |
|
NTP server 1. |
|
NTP server 2. |
|
NTP server 3. |
|
Options for assigning Network Time Protocol (NTP) servers to DHCP clients. Choices:
|
|
DHCP options. |
|
DHCP option code. |
|
ID. see <a href=’#notes’>Notes</a>. |
|
DHCP option IPs. |
|
DHCP option type. Choices:
|
|
Enable/disable user class identifier (UCI) matching. When enabled only DHCP requests with a matching UCI are served with this option. Choices:
|
|
One or more UCI strings in quotes separated by spaces. |
|
UCI strings. |
|
DHCP option value. |
|
Enable/disable vendor class identifier (VCI) matching. When enabled only DHCP requests with a matching VCI are served with this option. Choices:
|
|
One or more VCI strings in quotes separated by spaces. |
|
VCI strings. |
|
Relay agent IP. |
|
Enable/disable reservation of the extra IP addresses in the subnet. Choices:
|
|
Options for the DHCP server to assign IP settings to specific MAC addresses. |
|
Options for the DHCP server to configure the client with the reserved MAC address. Choices:
|
|
Option 82 circuit-ID of the client that will get the reserved IP address. |
|
DHCP option type. Choices:
|
|
Description. |
|
ID. see <a href=’#notes’>Notes</a>. |
|
Index of IP address to be reserved for the MAC address. |
|
MAC address of the client that will get the reserved IP address. |
|
Option 82 remote-ID of the client that will get the reserved IP address. |
|
DHCP option type. Choices:
|
|
DHCP reserved-address type. Choices:
|
|
DHCP server can be a normal DHCP server or an IPsec DHCP server. Choices:
|
|
Enable/disable shared subnet. Choices:
|
|
One or more hostnames or IP addresses of the TFTP servers in quotes separated by spaces. |
|
TFTP server. |
|
Select the time zone to be assigned to DHCP clients. Source system.timezone.name. |
|
Options for the DHCP server to set the client”s time zone. Choices:
|
|
Universally Unique Identifier (UUID; automatically assigned but can be manually reset). |
|
Enable/disable vendor class identifier (VCI) matching. When enabled only DHCP requests with a matching VCI are served. Choices:
|
|
One or more VCI strings in quotes separated by spaces. |
|
VCI strings. |
|
WiFi Access Controller 1 IP address (DHCP option 138, RFC 5417). |
|
WiFi Access Controller 2 IP address (DHCP option 138, RFC 5417). |
|
WiFi Access Controller 3 IP address (DHCP option 138, RFC 5417). |
|
Options for assigning WiFi access controllers to DHCP clients. Choices:
|
|
WINS server 1. |
|
WINS server 2. |
|
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. Default: |
Notes
Note
Legacy fortiosapi has been deprecated, httpapi is the preferred way to run playbooks
Examples
- name: Configure DHCP server templates.
fortinet.fortios.fortios_system_dhcp_template:
vdom: "{{ vdom }}"
state: "present"
access_token: "<your_own_value>"
system_dhcp_template:
auto_configuration: "disable"
conflicted_ip_timeout: "1800"
ddns_auth: "disable"
ddns_key: "<your_own_value>"
ddns_keyname: "<your_own_value>"
ddns_server_ip: "<your_own_value>"
ddns_ttl: "300"
ddns_update: "disable"
ddns_update_override: "disable"
ddns_zone: "<your_own_value>"
dns_server1: "<your_own_value>"
dns_server2: "<your_own_value>"
dns_server3: "<your_own_value>"
dns_server4: "<your_own_value>"
dns_service: "local"
domain: "<your_own_value>"
exclude_range:
-
id: "20"
ip_count: "0"
lease_time: "0"
oui_match: "disable"
oui_string:
-
oui_string: "<your_own_value>"
start_ip_index: "0"
uci_match: "disable"
uci_string:
-
uci_string: "<your_own_value>"
vci_match: "disable"
vci_string:
-
vci_string: "<your_own_value>"
vendor: "<your_own_value>"
fabric_force_sync: "enable"
fabric_object: "enable"
fabric_object_source: "member"
filename: "<your_own_value>"
forticlient_on_net_status: "disable"
ip_range:
-
id: "40"
ip_count: "0"
lease_time: "0"
oui_match: "disable"
oui_string:
-
oui_string: "<your_own_value>"
reserve: "disable"
uci_match: "disable"
uci_string:
-
uci_string: "<your_own_value>"
vci_match: "disable"
vci_string:
-
vci_string: "<your_own_value>"
vendor: "<your_own_value>"
ipsec_lease_hold: "60"
lease_time: "604800"
mac_acl_default_action: "assign"
name: "default_name_57"
next_server: "<your_own_value>"
ntp_server1: "<your_own_value>"
ntp_server2: "<your_own_value>"
ntp_server3: "<your_own_value>"
ntp_service: "local"
options:
-
code: "0"
id: "65"
ip: "<your_own_value>"
type: "hex"
uci_match: "disable"
uci_string:
-
uci_string: "<your_own_value>"
value: "<your_own_value>"
vci_match: "disable"
vci_string:
-
vci_string: "<your_own_value>"
relay_agent: "<your_own_value>"
reserve_extra_addresses: "disable"
reserved_address:
-
action: "assign"
circuit_id: "<your_own_value>"
circuit_id_type: "hex"
description: "<your_own_value>"
id: "82"
ip_index: "0"
mac: "<your_own_value>"
remote_id: "<your_own_value>"
remote_id_type: "hex"
type: "mac"
server_type: "regular"
shared_subnet: "disable"
tftp_server:
-
tftp_server: "<your_own_value>"
timezone: "<your_own_value> (source system.timezone.name)"
timezone_option: "disable"
uuid: "<your_own_value>"
vci_match: "disable"
vci_string:
-
vci_string: "<your_own_value>"
wifi_ac_service: "specify"
wifi_ac1: "<your_own_value>"
wifi_ac2: "<your_own_value>"
wifi_ac3: "<your_own_value>"
wins_server1: "<your_own_value>"
wins_server2: "<your_own_value>"
Return Values
Common return values are documented here, the following are the fields unique to this module:
Key |
Description |
|---|---|
Build number of the fortigate image Returned: always Sample: |
|
Last method used to provision the content into FortiGate Returned: always Sample: |
|
Last result given by FortiGate on last operation applied Returned: always Sample: |
|
Master key (id) used in the last call to FortiGate Returned: success Sample: |
|
Name of the table used to fulfill the request Returned: always Sample: |
|
Path of the table used to fulfill the request Returned: always Sample: |
|
Internal revision number Returned: always Sample: |
|
Serial number of the unit Returned: always Sample: |
|
Indication of the operation’s result Returned: always Sample: |
|
Virtual domain used Returned: always Sample: |
|
Version of the FortiGate Returned: always Sample: |