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 5 Next »

Use the nios_network module to create, update, or remove a network object from a NIOS Grid. It supports IPv4 as well as IPv6 networks.

The following table describes the parameters you can define in the nios_network module:

Parameter

Required/Optional

Description

name/network

Required

Specifies name of the network to add, update, or remove from NIOS.
The value must use CIDR notation.

network_view

Optional

Specifies the network view to associate the instance of the network object with.
If a value is not specified, the default network view configured in NIOS is used.

options

Optional

Specifies the set of DHCP options to be included as part of
the configured network instance.
This parameter accepts a list of subparameters. When you configure subparameters, at least one of the name or num parameters must be specified:

  • name: The name of the DHCP option to configure. The standard options are router, router-templates, domain-name-servers, domain-name, broadcast-address, broadcast-address-offset, dhcp-lease-time, and dhcp6.name-servers.

  • num: The number of the DHCP options to configure.

  • value (required): The value of the DHCP option specified by the name subparameter.

  • use_option: Enables a subset of options when it is set to yes (see the NIOS API documentation). The default value is yes.

  • vendor_class: The name of the space with which this DHCP option is associated. The default value is DHCP.

container

Optional

When the parameter is set to true, it enables the add, update, or delete operation on the network container.

extattrs

Optional

Specifies extensible attributes for the network object.

state

Optional

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

  • present (default): Configures the record.

  • absent: Removes the record.

comment

Optional

Describes the network 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_network module must be run locally.

Examples

name: Configure an IPv4 network
infoblox.nios_modules.nios_network:
  network: 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: Set dhcp options for a network ipv4
infoblox.nios_modules.nios_network:
  network: 192.168.10.0/24
  comment: this is a test comment
  options:
    - name: domain-name
      value: ansible.com
  state: present
  provider:
    host: <nios_hostname_or_hostip>
    username: <nios_username>
    password: <nios_password>
connection: local

name: Configure an ipv6 network container
infoblox.nios_modules.nios_network:
  network: fe80::/64
  container: true
  comment: test network container
  options:
    - name: domain-name
      value: ansible.com
  state: present
  provider:
    host: <nios_hostname_or_hostip>
    username: <nios_username>
    password: <nios_password>
connection: local

  • No labels