Host Record
Use the nios_host_record
module to create, update, or remove a host record object from a NIOS Grid.
The following table describes the parameters you can define in the nios_host_record
module:
Parameter | Required/Optional | Description |
---|---|---|
| Required | Specifies the fully qualified host name to add or remove from NIOS.
|
| Optional | Specifies the DNS view to associate the host record with. |
| Optional | Sets the DNS to a particular parent. The default value is |
| Optional | Specifies whether the extensible attribute must be inherited from the associated zone. The default value is |
| *Optional | Specifies the IPv4 address for the host record. You can configure the following subparameters:
|
| *Optional | Specifies the IPv6 address for the host record. You can configure the following subparameters:
|
| Optional | Specifies an optional list of additional aliases to add to the host record. |
| Optional | Specifies the Time To Live (TTL) value for the record. |
| Optional | Specifies extensible attributes for the host record object. |
| Optional | Specifies the state of the host record instance on the NIOS server.
|
| Optional | Describes the host record object. |
| Required | Defines the details of the connection:
For information on additional fields you can define, see the list of subparameters in the NIOS Modules for Ansible Collections topic. |
| Required | The |
Note
*When creating a host record, ensure that ipv4addrs
, ipv6addrs
, or both are specified.
Examples
name: configure an ipv4 host record
infoblox.nios_modules.nios_host_record:
name: host.ansible.com
ipv4:
- address: 192.168.10.1
aliases:
- cname.ansible.com
state: present
provider:
host: <nios_hostname_or_hostip>
username: <nios_username>
password: <nios_password>
connection: local
name: Create an ipv4 host record bypassing DNS
infoblox.nios_modules.nios_host_record:
name: new_host
ipv4:
- address: 192.168.10.1
dns: false
state: present
provider:
host: <nios_hostname_or_hostip>
username: <nios_username>
password: <nios_password>
connection: local
name: Create an ipv4 host record over DHCP
infoblox.nios_modules.nios_host_record:
name: host.ansible.com
ipv4:
- address: 192.168.10.1
dhcp: true
mac: 00-80-C8-E3-4C-BD
state: present
provider:
host: <nios_hostname_or_hostip>
username: <nios_username>
password: <nios_password>
connection: local
name: Dynamically add host record to next available ip
infoblox.nios_modules.nios_host_record:
name: host.ansible.com
ipv4:
- address: {nios_next_ip: 192.168.10.0/24}
comment: this is a test comment
state: present
provider:
host: <nios_hostname_or_hostip>
username: <nios_username>
password: <nios_password>
connection: local
name: Create an ipv4 host record with DNS EA inheritance enabled
infoblox.nios_modules.nios_host_record:
name: host.ansible.com
configure_for_dns: true
use_dns_ea_inheritance: true
ipv4:
- address: 192.168.10.1
dhcp: true
mac: 00-80-C8-E3-4C-BD
state: present
provider:
host: "{{ inventory_hostname_short }}"
username: admin
password: admin
connection: local
name: Create an ipv4 host record with host address EA inheritance enabled
infoblox.nios_modules.nios_host_record:
name: host.ansible.com
configure_for_dns: true
ipv4:
- address: 192.168.10.1
dhcp: true
mac: 00-80-C8-E3-4C-BD
use_for_ea_inheritance: true
state: present
provider:
host: "{{ inventory_hostname_short }}"
username: admin
password: admin
connection: local
name: Create an ipv4 host record over DHCP with PXE server
infoblox.nios_modules.nios_host_record:
name: host.ansible.com
ipv4:
- address: 192.168.10.1
dhcp: true
mac: 00-80-C8-E3-4C-BD
use_nextserver: true
nextserver: pxe-server.com
state: present
provider:
host: "{{ inventory_hostname_short }}"
username: admin
password: admin
connection: local
name: Update an ipv4 host record
infoblox.nios_modules.nios_host_record:
name: {new_name: host-new.ansible.com, old_name: host.ansible.com}
ipv4:
- address: 192.168.10.1
state: present
provider:
host: <nios_hostname_or_hostip>
username: <nios_username>
password: <nios_password>
connection: local
name: Create host record with IPv4 and IPv6 addresses
infoblox.nios_modules.nios_host_record:
name: hostrec.ansible.com
ipv4:
- address: 192.168.10.7
mac: 12:80:C8:E3:4C:AB
ipv6:
- address: fe80::10
duid: 12:80:C8:E3:4C:B4
state: present
provider:
host: <nios_hostname_or_hostip>
username: <nios_username>
password: <nios_password>
connection: local