vmware.vmware_rest.appliance_networking_interfaces_ipv4 module – Manage the IPv4 configuration of a vCenter Server Appliance network interface.
Note
This module is part of the vmware.vmware_rest collection (version 5.0.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 vmware.vmware_rest.
To use it in a playbook, specify: vmware.vmware_rest.appliance_networking_interfaces_ipv4.
New in vmware.vmware_rest 5.0.0
Synopsis
Configure the IPv4 settings of a specific network interface on the vCenter Server Appliance.
The address can be assigned automatically by a DHCP server, set statically, or left unconfigured.
When
mode=STATIC, provideaddressandprefix, and optionallydefault_gateway.Use vmware.vmware_rest.appliance_networking_interfaces_ipv4_info to view the current IPv4 configuration.
Parameters
Parameter |
Comments |
|---|---|
The IPv4 address to assign to the interface, for example Only relevant when This property was added in vSphere API 6.7. |
|
The IPv4 address of the default gateway for the appliance. This sets the global default gateway using the specified gateway address and interface, replacing any existing default gateway. A link-local gateway address is added only for this interface. Configuring multiple global default gateways through different interfaces is not supported. This property was added in vSphere API 6.7. |
|
The name of the network interface to configure, for example The value is the identifier of an interface returned by vmware.vmware_rest.appliance_networking_interfaces_info. |
|
The IPv4 CIDR prefix length, for example Only relevant when This property was added in vSphere API 6.7. |
|
Timeout in seconds for the whole operation including connection establishment, request sending, and response. Default: |
|
The desired state of the interface IPv4 configuration. Use Choices:
|
|
The hostname or IP address of the vSphere vCenter. If the value is not specified in the task, the value of environment variable |
|
The vSphere vCenter password. If the value is not specified in the task, the value of environment variable |
|
The port number of the vSphere vCenter. If the value is not specified in the task, the value of environment variable |
|
Optional path to a log file for HTTP REST interaction. If the value is not specified in the task, the value of environment variable |
|
The vSphere vCenter username. If the value is not specified in the task, the value of environment variable |
|
Allows connection when SSL certificates are not valid. Set to If the value is not specified in the task, the value of environment variable Choices:
|
Notes
Note
Generated from vSphere API spec 9.1.0.
Compatible with vSphere API 7.0.3.
Compatible with vSphere API 8.0.2.
Examples
- name: Configure nic0 to obtain an IPv4 address via DHCP
vmware.vmware_rest.appliance_networking_interfaces_ipv4:
interface_name: nic0
mode: DHCP
state: present
- name: Assign a static IPv4 address to nic0
vmware.vmware_rest.appliance_networking_interfaces_ipv4:
interface_name: nic0
mode: STATIC
address: 10.20.80.191
prefix: 24
default_gateway: 10.20.80.1
state: present
- name: Disable IPv4 on nic0
vmware.vmware_rest.appliance_networking_interfaces_ipv4:
interface_name: nic0
mode: UNCONFIGURED
state: present
Return Values
Common return values are documented here, the following are the fields unique to this module:
Key |
Description |
|---|---|
The raw API response body from the vCenter operation. Empty when the operation returns no content. Returned: On success Sample: |