Skip to end of metadata
Go to start of metadata

You are viewing an old version of this content. View the current version.

Compare with Current View Version History

« Previous Version 9 Next »

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

name

Required

Specifies the fully qualified host name to add or remove from NIOS.
To update the name of a host record object, define a dictionary object that contains the following parameters:

  • old_name: Specifies the existing host name that must be changed.

  • new_name: Specifies the new host name.

view

Optional

Specifies the DNS view to associate the 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 record.

You can configure the following subparameters:

  • ipv4addr (required): Specifies the IPv4 address for this host record.
    You can dynamically allocate an IPv4 address to the 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: Sets it to true to configure the host record over DHCP rather than DNS and then define the MAC address.

  • mac: Specifies the hardware MAC address for the host record. You must specify this value if configure_for_dhcp is set to true.

  • add: Specifies whether the IPv4 address must be added to an existing host record. Set it to true to add the IPv4 address. Set the value of the state parameter to present because the new IP address is allocated to the existing host record.

  • remove: Specifies whether the IPv4 address must be removed from an existing host record. Set it to true to remove the IPv4 address.
    Set the state parameter to absent because the IP address is de-allocated from the host record.

ipv6addrs

*Optional

Specifies the IPv6 address for the host record. You can configure the following subparameters:

  • ipv6addr (required): Specifies the IPv6 address for the host record.
    If you want to add or remove the IPv6 address from an existing record, use parameters.

  • configure_for_dhcp: Determines whether the host record is configured over DHCP. Set it to true to configure the record over DHCP rather than DNS and then define the MAC address.

  • mac: Specifies 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 record.
These are equivalent to CNAMEs but held within a host 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 record object.

state

Optional

Specifies the state of the host record instance on the NIOS server.
Set one of the following values:

  • present (default): Configures the record.

  • absent: Removes the record.

comment

Optional

Describes the 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

*When creating a host record, ensure that ipv4addrsipv6addrs, 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: 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

  • No labels