fortinet.fortimanager.fmgr_system_dhcp_template module – Configure DHCP server templates.
Note
This module is part of the fortinet.fortimanager collection (version 2.16.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_template.
New in fortinet.fortimanager 2.16.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 change note that can be specified when an object is created or updated. |
|
The directive to create, update or delete an object. Choices:
|
|
The top level parameters set. |
|
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 |
|
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 |
|
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. |
|
ID. |
|
Number of IP addresses to include in the range. |
|
Lease time in seconds, 0 means default lease time. |
|
Enable/disable organizationally unique identifier Choices:
|
|
One or more OUI strings in quotes separated by spaces |
|
Start of IP range. |
|
Enable/disable user class identifier Choices:
|
|
One or more UCI strings in quotes separated by spaces. |
|
Enable/disable vendor class identifier Choices:
|
|
One or more VCI strings in quotes separated by spaces. |
|
Vendor this ip-range will be assigned to. |
|
Enable/disable forced synchronization of configuration objects from the root FortiGate unit to the downstream devices. Choices:
|
|
Security Fabric global object setting. Choices:
|
|
Fabric object source. Choices:
|
|
Name of the boot file on the TFTP server. |
|
Enable/disable FortiClient-On-Net service for this DHCP server. Choices:
|
|
Ip range. |
|
ID. |
|
Number of IP addresses to include in the range. |
|
Lease time in seconds, 0 means default lease time. |
|
Enable/disable organizationally unique identifier Choices:
|
|
One or more OUI strings in quotes separated by spaces |
|
Enable/disable address reservation for use without DHCP. Choices:
|
|
Enable/disable user class identifier Choices:
|
|
One or more UCI strings in quotes separated by spaces. |
|
Enable/disable vendor class identifier Choices:
|
|
One or more VCI strings in quotes separated by spaces. |
|
Vendor this ip-range will be assigned to. |
|
DHCP over IPsec leases expire this many seconds after tunnel down |
|
Lease time in seconds, 0 means unlimited. |
|
MAC access control default action 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 Choices:
|
|
Options. |
|
DHCP option code. |
|
ID. |
|
DHCP option IPs. |
|
DHCP option type. Choices:
|
|
Enable/disable user class identifier Choices:
|
|
One or more UCI strings in quotes separated by spaces. |
|
DHCP option value. |
|
Enable/disable vendor class identifier Choices:
|
|
One or more VCI strings in quotes separated by spaces. |
|
Relay agent IP. |
|
Enable/disable reservation of the extra IP addresses in the subnet. Choices:
|
|
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. |
|
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. |
|
Select the time zone to be assigned to DHCP clients. |
|
Options for the DHCP server to set the clients time zone. Choices:
|
|
Universally Unique Identifier |
|
Enable/disable vendor class identifier Choices:
|
|
One or more VCI strings in quotes separated by spaces. |
|
WiFi Access Controller 1 IP address |
|
WiFi Access Controller 2 IP address |
|
WiFi Access Controller 3 IP address |
|
Options for assigning WiFi access controllers to DHCP clients. Choices:
|
|
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
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.
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
To create or update an object, use state present directive.
To delete an object, use state absent directive.
Examples
- name: Example playbook (generated based on argument schema)
hosts: fortimanagers
connection: httpapi
gather_facts: false
tasks:
- name: Configure DHCP server templates.
fortinet.fortimanager.fmgr_system_dhcp_template:
# workspace_locking_adom: <global or your adom name>
adom: <your own value>
state: present # <value in [present, absent]>
system_dhcp_template:
name: "your value" # Required variable, string
# 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>
# dns_server1: <string>
# dns_server2: <string>
# dns_server3: <string>
# dns_server4: <string>
# dns_service: <value in [default, specify, local]>
# domain: <string>
# exclude_range:
# - id: <integer>
# ip_count: <integer>
# lease_time: <integer>
# oui_match: <value in [disable, enable]>
# oui_string: <list or string>
# start_ip_index: <integer>
# uci_match: <value in [disable, enable]>
# uci_string: <list or string>
# vci_match: <value in [disable, enable]>
# vci_string: <list or string>
# vendor: <string>
# fabric_force_sync: <value in [disable, enable]>
# fabric_object: <value in [disable, enable]>
# fabric_object_source: <value in [member, local, root]>
# filename: <string>
# forticlient_on_net_status: <value in [disable, enable]>
# ip_range:
# - id: <integer>
# ip_count: <integer>
# lease_time: <integer>
# oui_match: <value in [disable, enable]>
# oui_string: <list or string>
# reserve: <value in [disable, enable]>
# uci_match: <value in [disable, enable]>
# uci_string: <list or string>
# vci_match: <value in [disable, enable]>
# vci_string: <list or string>
# vendor: <string>
# ipsec_lease_hold: <integer>
# lease_time: <integer>
# mac_acl_default_action: <value in [block, assign]>
# next_server: <string>
# ntp_server1: <string>
# ntp_server2: <string>
# ntp_server3: <string>
# ntp_service: <value in [default, specify, local]>
# options:
# - code: <integer>
# id: <integer>
# ip: <string>
# type: <value in [hex, string, ip, ...]>
# uci_match: <value in [disable, enable]>
# uci_string: <list or string>
# value: <string>
# vci_match: <value in [disable, enable]>
# vci_string: <list or string>
# relay_agent: <string>
# reserve_extra_addresses: <value in [disable, enable]>
# reserved_address:
# - action: <value in [assign, block, reserved]>
# circuit_id: <string>
# circuit_id_type: <value in [hex, string]>
# description: <string>
# id: <integer>
# ip_index: <integer>
# mac: <string>
# remote_id: <string>
# remote_id_type: <value in [hex, string]>
# type: <value in [mac, option82]>
# server_type: <value in [regular, ipsec]>
# shared_subnet: <value in [disable, enable]>
# tftp_server: <list or string>
# timezone: <list or string>
# timezone_option: <value in [disable, default, specify]>
# uuid: <string>
# vci_match: <value in [disable, enable]>
# vci_string: <list or string>
# wifi_ac_service: <value in [specify, local]>
# wifi_ac1: <string>
# wifi_ac2: <string>
# wifi_ac3: <string>
# wins_server1: <string>
# wins_server2: <string>
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 |