fortinet.fortimanager.fmgr_system_dhcp_server module – Configure DHCP servers.
Note
This module is part of the fortinet.fortimanager collection (version 2.3.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.fortimanager
.
To use it in a playbook, specify: fortinet.fortimanager.fmgr_system_dhcp_server
.
New in fortinet.fortimanager 2.0.0
Synopsis
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.
Parameters
Parameter |
Comments |
---|---|
The token to access FortiManager without using username and password. |
|
the parameter (adom) in requested url |
|
Only set to True when module schema diffs with FortiManager API structure, module continues to execute without validating parameters. Choices:
|
|
Enable/Disable logging for task. Choices:
|
|
Authenticate Ansible client with forticloud API access token. |
|
The overridden method for the underlying Json RPC request. Choices:
|
|
The rc codes list with which the conditions to fail will be overriden. |
|
The rc codes list with which the conditions to succeed will be overriden. |
|
The directive to create, update or delete an object. Choices:
|
|
the top level parameters set |
|
Enable/disable auto configuration. Choices:
|
|
Enable/disable use of this DHCP server once this interface has been assigned an IP address from FortiIPAM. 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:
|
|
(list or str) DDNS update key |
|
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 |
|
Default gateway IP address assigned by the DHCP server. |
|
Enable/disable populating of DHCP server settings from FortiIPAM. Choices:
|
|
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-Range. |
|
End of IP range. |
|
ID. |
|
Lease time in seconds, 0 means default lease time. |
|
Start of IP range. |
|
Enable/disable user class identifier Choices:
|
|
(list) no description |
|
Enable/disable vendor class identifier Choices:
|
|
(list) no description |
|
Name of the boot file on the TFTP server. |
|
Enable/disable FortiClient-On-Net service for this DHCP server. Choices:
|
|
ID. |
|
DHCP server can assign IP configurations to clients connected to this interface. |
|
Method used to assign client IP. Choices:
|
|
Ip-Range. |
|
End of IP range. |
|
ID. |
|
Lease time in seconds, 0 means default lease time. |
|
Start of IP range. |
|
Enable/disable user class identifier Choices:
|
|
(list) no description |
|
Enable/disable vendor class identifier Choices:
|
|
(list) no description |
|
DHCP over IPsec leases expire this many seconds after tunnel down |
|
Lease time in seconds, 0 means unlimited. |
|
MAC access control default action Choices:
|
|
Netmask assigned by the DHCP server. |
|
IP address of a server |
|
NTP server 1. |
|
NTP server 2. |
|
NTP server 3. |
|
Options for assigning Network Time Protocol Choices:
|
|
Options. |
|
DHCP option code. |
|
ID. |
|
(list) DHCP option IPs. |
|
DHCP option type. Choices:
|
|
Enable/disable user class identifier Choices:
|
|
(list) no description |
|
DHCP option value. |
|
Enable/disable vendor class identifier Choices:
|
|
(list) no description |
|
Relay agent IP. |
|
Reserved-Address. |
|
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. |
|
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:
|
|
Enable/disable this DHCP configuration. Choices:
|
|
(list) One or more hostnames or IP addresses of the TFTP servers in quotes separated by spaces. |
|
Select the time zone to be assigned to DHCP clients. Choices:
|
|
Options for the DHCP server to set the clients time zone. Choices:
|
|
Enable/disable vendor class identifier Choices:
|
|
(list) One or more VCI strings in quotes separated by spaces. |
|
Options for assigning WiFi Access Controllers to DHCP clients Choices:
|
|
WiFi Access Controller 1 IP address |
|
WiFi Access Controller 2 IP address |
|
WiFi Access Controller 3 IP address |
|
WINS server 1. |
|
WINS server 2. |
|
The adom to lock for FortiManager running in workspace mode, the value can be global and others including root. |
|
The maximum time in seconds to wait for other user to release the workspace lock. Default: |
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: gathering fortimanager facts
hosts: fortimanager00
gather_facts: no
connection: httpapi
collections:
- fortinet.fortimanager
vars:
ansible_httpapi_use_ssl: True
ansible_httpapi_validate_certs: False
ansible_httpapi_port: 443
tasks:
- name: retrieve all the DHCP servers
fmgr_fact:
facts:
selector: 'system_dhcp_server'
params:
adom: 'ansible'
server: 'your_value'
- hosts: fortimanager00
collections:
- fortinet.fortimanager
connection: httpapi
vars:
ansible_httpapi_use_ssl: True
ansible_httpapi_validate_certs: False
ansible_httpapi_port: 443
tasks:
- name: Configure DHCP servers.
fmgr_system_dhcp_server:
bypass_validation: False
adom: ansible
state: present
system_dhcp_server:
auto-configuration: enable #<value in [disable, enable]>
default-gateway: '222.222.222.1'
filename: ansible-file
id: 1
interface: any
ip-mode: range #<value in [range, usrgrp]>
ip-range:
-
end-ip: 222.222.222.22
id: 1
start-ip: 222.222.222.2
netmask: 255.255.255.0
server-type: regular #<value in [regular, ipsec]>
status: disable #<value in [disable, enable]>
Return Values
Common return values are documented here, the following are the fields unique to this module:
Key |
Description |
---|---|
The result of the request. Returned: always |
|
The full url requested. Returned: always Sample: |
|
The status of api request. Returned: always Sample: |
|
The api response. Returned: always |
|
The descriptive message of the api response. Returned: always Sample: |
|
The information of the target system. Returned: always |
|
The status the request. Returned: always Sample: |
|
Warning if the parameters used in the playbook are not supported by the current FortiManager version. Returned: complex |