fortinet.fortimanager.fmgr_system_dhcp_server module – Configure DHCP servers.
Note
This module is part of the fortinet.fortimanager collection (version 2.7.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. |
|
Deprecated, please rename it to auto_configuration. Enable/disable auto configuration. Choices:
|
|
Deprecated, please rename it to auto_managed_status. Enable/disable use of this DHCP server once this interface has been a… Choices:
|
|
Deprecated, please rename it to conflicted_ip_timeout. Time in seconds to wait after a conflicted IP address is removed fr… |
|
Deprecated, please rename it to ddns_auth. DDNS authentication mode. Choices:
|
|
(list or str) Deprecated, please rename it to ddns_key. DDNS update key |
|
Deprecated, please rename it to ddns_keyname. DDNS update key name. |
|
Deprecated, please rename it to ddns_server_ip. DDNS server IP. |
|
Deprecated, please rename it to ddns_ttl. TTL. |
|
Deprecated, please rename it to ddns_update. Enable/disable DDNS update for DHCP. Choices:
|
|
Deprecated, please rename it to ddns_update_override. Enable/disable DDNS update override for DHCP. Choices:
|
|
Deprecated, please rename it to ddns_zone. Zone of your domain name |
|
Deprecated, please rename it to default_gateway. Default gateway IP address assigned by the DHCP server. |
|
Deprecated, please rename it to dhcp_settings_from_fortiipam. Enable/disable populating of DHCP server settings from Forti… Choices:
|
|
Deprecated, please rename it to dns_server1. DNS server 1. |
|
Deprecated, please rename it to dns_server2. DNS server 2. |
|
Deprecated, please rename it to dns_server3. DNS server 3. |
|
Deprecated, please rename it to dns_server4. DNS server 4. |
|
Deprecated, please rename it to dns_service. Options for assigning DNS servers to DHCP clients. Choices:
|
|
Domain name suffix for the IP addresses that the DHCP server assigns to clients. |
|
Deprecated, please rename it to exclude_range. Exclude range. |
|
Deprecated, please rename it to end_ip. End of IP range. |
|
ID. |
|
Deprecated, please rename it to lease_time. Lease time in seconds, 0 means default lease time. |
|
Deprecated, please rename it to start_ip. Start of IP range. |
|
Deprecated, please rename it to uci_match. Enable/disable user class identifier Choices:
|
|
(list) Deprecated, please rename it to uci_string. One or more UCI strings in quotes separated by spaces. |
|
Deprecated, please rename it to vci_match. Enable/disable vendor class identifier Choices:
|
|
(list) Deprecated, please rename it to vci_string. One or more VCI strings in quotes separated by spaces. |
|
Name of the boot file on the TFTP server. |
|
Deprecated, please rename it to forticlient_on_net_status. Enable/disable FortiClient-On-Net service for this DHCP server. Choices:
|
|
ID. |
|
DHCP server can assign IP configurations to clients connected to this interface. |
|
Deprecated, please rename it to ip_mode. Method used to assign client IP. Choices:
|
|
Deprecated, please rename it to ip_range. Ip range. |
|
Deprecated, please rename it to end_ip. End of IP range. |
|
ID. |
|
Deprecated, please rename it to lease_time. Lease time in seconds, 0 means default lease time. |
|
Deprecated, please rename it to start_ip. Start of IP range. |
|
Deprecated, please rename it to uci_match. Enable/disable user class identifier Choices:
|
|
(list) Deprecated, please rename it to uci_string. One or more UCI strings in quotes separated by spaces. |
|
Deprecated, please rename it to vci_match. Enable/disable vendor class identifier Choices:
|
|
(list) Deprecated, please rename it to vci_string. One or more VCI strings in quotes separated by spaces. |
|
Deprecated, please rename it to ipsec_lease_hold. DHCP over IPsec leases expire this many seconds after tunnel down |
|
Deprecated, please rename it to lease_time. Lease time in seconds, 0 means unlimited. |
|
Deprecated, please rename it to mac_acl_default_action. MAC access control default action Choices:
|
|
Netmask assigned by the DHCP server. |
|
Deprecated, please rename it to next_server. IP address of a server |
|
Deprecated, please rename it to ntp_server1. NTP server 1. |
|
Deprecated, please rename it to ntp_server2. NTP server 2. |
|
Deprecated, please rename it to ntp_server3. NTP server 3. |
|
Deprecated, please rename it to ntp_service. Options for assigning Network Time Protocol Choices:
|
|
Options. |
|
DHCP option code. |
|
ID. |
|
(list) DHCP option IPs. |
|
DHCP option type. Choices:
|
|
Deprecated, please rename it to uci_match. Enable/disable user class identifier Choices:
|
|
(list) Deprecated, please rename it to uci_string. One or more UCI strings in quotes separated by spaces. |
|
DHCP option value. |
|
Deprecated, please rename it to vci_match. Enable/disable vendor class identifier Choices:
|
|
(list) Deprecated, please rename it to vci_string. One or more VCI strings in quotes separated by spaces. |
|
Deprecated, please rename it to relay_agent. Relay agent IP. |
|
Deprecated, please rename it to reserved_address. Reserved address. |
|
Options for the DHCP server to configure the client with the reserved MAC address. Choices:
|
|
Deprecated, please rename it to circuit_id. Option 82 circuit-ID of the client that will get the reserved IP address. |
|
Deprecated, please rename it to circuit_id_type. 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. |
|
Deprecated, please rename it to remote_id. Option 82 remote-ID of the client that will get the reserved IP address. |
|
Deprecated, please rename it to remote_id_type. DHCP option type. Choices:
|
|
DHCP reserved-address type. Choices:
|
|
Deprecated, please rename it to server_type. DHCP server can be a normal DHCP server or an IPsec DHCP server. Choices:
|
|
Deprecated, please rename it to shared_subnet. Enable/disable shared subnet. Choices:
|
|
Enable/disable this DHCP configuration. Choices:
|
|
(list) Deprecated, please rename it to tftp_server. One or more hostnames or IP addresses of the TFTP servers in quotes se… |
|
Select the time zone to be assigned to DHCP clients. Choices:
|
|
Deprecated, please rename it to timezone_option. Options for the DHCP server to set the clients time zone. Choices:
|
|
Deprecated, please rename it to vci_match. Enable/disable vendor class identifier Choices:
|
|
(list) Deprecated, please rename it to vci_string. One or more VCI strings in quotes separated by spaces. |
|
Deprecated, please rename it to wifi_ac_service. Options for assigning WiFi Access Controllers to DHCP clients Choices:
|
|
Deprecated, please rename it to wifi_ac1. WiFi Access Controller 1 IP address |
|
Deprecated, please rename it to wifi_ac2. WiFi Access Controller 2 IP address |
|
Deprecated, please rename it to wifi_ac3. WiFi Access Controller 3 IP address |
|
Deprecated, please rename it to wins_server1. WINS server 1. |
|
Deprecated, please rename it to wins_server2. 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
Starting in version 2.4.0, all input arguments are named using the underscore naming convention (snake_case). Please change the arguments such as “var-name” to “var_name”. Old argument names are still available yet you will receive deprecation warnings. You can ignore this warning by setting deprecation_warnings=False in ansible.cfg.
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: Example playbook
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_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]>
- name: Gathering fortimanager facts
hosts: fortimanagers
gather_facts: false
connection: httpapi
vars:
ansible_httpapi_use_ssl: true
ansible_httpapi_validate_certs: false
ansible_httpapi_port: 443
tasks:
- name: Retrieve all the DHCP servers
fortinet.fortimanager.fmgr_fact:
facts:
selector: "system_dhcp_server"
params:
adom: "ansible"
server: "your_value"
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 |