Use the nios_host_record
module to create, update, or remove a host record object from a NIOS Grid.
...
Parameter | Required/Optional | Description |
---|
name
| Required | Specifies the fully qualified host name to add or remove from NIOS. |
view
| Optional | Specifies the DNS view to associate the Host host record with. If a value is not specified, the default DNS view configured in NIOS is used. |
configure_for_dns
| Optional | Sets the DNS to a particular parent. The default value is true . If you need to bypass the DNS, set the value to false . |
ipv4addrs
| *Optional | Specifies the IPv4 address for the Host host record. You can configure the following subparameters: ipv4addr (required): Specify the IPv4 address for this Host host record. You can dynamically allocate an IPv4 address to the Host host record by passing a dictionary that contains nios_next_ip and CIDR network range. If you want to add or remove the IPv4 address from an existing record, use the parameters.
configure_for_dhcp : Set it to true to configure the Host host record over DHCP rather than DNS and then define the MAC address.
mac : Specify the hardware MAC address for the host record. You must specify this value if configure_for_dhcp is set to true .
add : To add the IPv4 address to an existing Host host record, set the value to true . Set the value of the state parameter to present because the new IP address is allocated to the existing Host host record.
remove : If you want to remove the IPv4 address from an existing record, set it to true . Set the state parameter to absent because the IP address is de-allocated from the Host host record.
|
ipv6addrs
| *Optional | Specifies the IPv6 address for the Host host record. You can configure the following subparameters: ipv6addr (required): Specify the IPv6 address for the Host host record. If you want to add or remove the IPv6 address from an existing record, use parameters.
configure_for_dhcp : Set it to true to configure the Host host record over DHCP rather than DNS and then define the MAC address.
mac : Specify the hardware MAC address for the host record. You must specify this value if configure_for_dhcp is set to true .
|
aliases
| Optional | Specifies an optional list of additional aliases to add to the Host recordhost record. These are equivalent to CNAMEs but held within a Host recordhost record. The value must be formatted as a list. |
ttl
| Optional | Specifies the Time To Live (TTL) value for the record. The duration that the record is valid for, in seconds (cached). |
extattrs
| Optional | Specifies extensible attributes for the Host host record object. |
state
| Optional | Specifies the state of the Host host record instance on the NIOS server. Set one of the following values: |
comment
| Optional | Describes the Host host record object. |
provider
| Required | Defines the details of the connection: host : The DNS host name or IP address to connect to the remote instance of NIOS.
username : The user name to use for authenticating the connection to the remote instance.
password : The password to use for authenticating the connection to the remote instance.
For information on additional fields you can define, see the list of subparameters in the NIOS Modules for Ansible Collections topic. |
connection
| Required | The nios_host_record module must be run locally. |
Note |
---|
Note*When creating a Host 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
...