community.vmware.vmware_host_tcpip_stacks – Manage the TCP/IP Stacks configuration of ESXi host

Note

This plugin is part of the community.vmware collection (version 1.17.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 community.vmware.

To use it in a playbook, specify: community.vmware.vmware_host_tcpip_stacks.

New in version 1.10.0: of community.vmware

Synopsis

  • This module can be used to modify the TCP/IP stacks configuration.

Requirements

The below requirements are needed on the host that executes this module.

  • python >= 2.7

  • PyVmomi

Parameters

Parameter

Comments

default

dictionary

The TCP/IP stacks configuration of the default.

alternate_dns

string

The IP address of the alternate dns server.

congestion_algorithm

string

The TCP congest control algorithm.

Choices:

  • newreno ← (default)

  • cubic

domain

string / required

The domain name portion of the DNS name.

gateway

string

The ipv4 gateway address.

hostname

string / required

The host name of the ESXi host.

ipv6_gateway

string

added in 1.11.0 of community.vmware

The ipv6 gateway address.

max_num_connections

integer

The maximum number of socket connection that are requested.

Default: 11000

preferred_dns

string

The IP address of the preferred dns server.

search_domains

list / elements=string

The domain in which to search for hosts, placed in order of preference.

Default: []

esxi_hostname

string / required

Name of the ESXi host.

hostname

string

The hostname or IP address of the vSphere vCenter or ESXi server.

If the value is not specified in the task, the value of environment variable VMWARE_HOST will be used instead.

Environment variable support added in Ansible 2.6.

password

aliases: pass, pwd

string

The password of the vSphere vCenter or ESXi server.

If the value is not specified in the task, the value of environment variable VMWARE_PASSWORD will be used instead.

Environment variable support added in Ansible 2.6.

port

integer

The port number of the vSphere vCenter or ESXi server.

If the value is not specified in the task, the value of environment variable VMWARE_PORT will be used instead.

Environment variable support added in Ansible 2.6.

Default: 443

provisioning

dictionary

The TCP/IP stacks configuration of the provisioning.

congestion_algorithm

string

The TCP congest control algorithm.

Choices:

  • newreno ← (default)

  • cubic

gateway

string

The ipv4 gateway address.

ipv6_gateway

string

added in 1.11.0 of community.vmware

The ipv6 gateway address.

max_num_connections

integer

The maximum number of socket connection that are requested.

Default: 11000

proxy_host

string

Address of a proxy that will receive all HTTPS requests and relay them.

The format is a hostname or a IP.

If the value is not specified in the task, the value of environment variable VMWARE_PROXY_HOST will be used instead.

This feature depends on a version of pyvmomi greater than v6.7.1.2018.12

proxy_port

integer

Port of the HTTP proxy that will receive all HTTPS requests and relay them.

If the value is not specified in the task, the value of environment variable VMWARE_PROXY_PORT will be used instead.

username

aliases: admin, user

string

The username of the vSphere vCenter or ESXi server.

If the value is not specified in the task, the value of environment variable VMWARE_USER will be used instead.

Environment variable support added in Ansible 2.6.

validate_certs

boolean

Allows connection when SSL certificates are not valid. Set to false when certificates are not trusted.

If the value is not specified in the task, the value of environment variable VMWARE_VALIDATE_CERTS will be used instead.

Environment variable support added in Ansible 2.6.

If set to true, please make sure Python >= 2.7.9 is installed on the given machine.

Choices:

  • no

  • yes ← (default)

vmotion

dictionary

The TCP/IP stacks configuration of the vmotion.

congestion_algorithm

string

The TCP congest control algorithm.

Choices:

  • newreno ← (default)

  • cubic

gateway

string

The ipv4 gateway address.

ipv6_gateway

string

added in 1.11.0 of community.vmware

The ipv6 gateway address.

max_num_connections

integer

The maximum number of socket connection that are requested.

Default: 11000

vxlan

aliases: nsx_overlay

dictionary

The TCP/IP stacks configuration of the vxlan.

congestion_algorithm

string

The TCP congest control algorithm.

Choices:

  • newreno ← (default)

  • cubic

gateway

string

The ipv4 gateway address.

ipv6_gateway

string

added in 1.11.0 of community.vmware

The ipv6 gateway address.

max_num_connections

integer

The maximum number of socket connection that are requested.

Default: 11000

Notes

Note

  • All modules requires API write access and hence is not supported on a free ESXi license.

Examples

- name: Update the TCP/IP stack configuration of the default
  community.vmware.vmware_host_tcpip_stacks:
    hostname: "{{ vcenter_hostname }}"
    username: "{{ vcenter_username }}"
    password: "{{ vcenter_password }}"
    validate_certs: false
    esxi_hostname: "{{ esxi_hostname }}"
    default:
      hostname: "{{ esxi_hostname }}"
      domain: example.com
      preferred_dns: 192.168.10.1
      alternate_dns: 192.168.20.1
      search_domains:
        - hoge.com
        - fuga.com
      gateway: 192.168.10.1
      congestion_algorithm: cubic
      max_num_connections: 12000

- name: Update the TCP/IP stack configuration of the provisioning
  community.vmware.vmware_host_tcpip_stacks:
    hostname: "{{ vcenter_hostname }}"
    username: "{{ vcenter_username }}"
    password: "{{ vcenter_password }}"
    validate_certs: false
    esxi_hostname: "{{ esxi_hostname }}"
    provisioning:
      congestion_algorithm: newreno
      max_num_connections: 12000
      gateway: 10.10.10.254

- name: Update the TCP/IP stack configuration of the default and provisioning
  community.vmware.vmware_host_tcpip_stacks:
    hostname: "{{ vcenter_hostname }}"
    username: "{{ vcenter_username }}"
    password: "{{ vcenter_password }}"
    validate_certs: false
    esxi_hostname: "{{ esxi_hostname }}"
    default:
      hostname: "{{ esxi_hostname }}"
      domain: example.com
      preferred_dns: 192.168.10.1
      alternate_dns: 192.168.20.1
      search_domains:
        - hoge.com
        - fuga.com
      gateway: 192.168.10.1
      congestion_algorithm: cubic
      max_num_connections: 12000
    provisioning:
      congestion_algorithm: newreno
      max_num_connections: 12000
      gateway: 10.10.10.254

- name: Update the ipv6 gateway of the provisioning TCP/IP stack
  community.vmware.vmware_host_tcpip_stacks:
    hostname: "{{ vcenter_hostname }}"
    username: "{{ vcenter_username }}"
    password: "{{ vcenter_password }}"
    validate_certs: false
    esxi_hostname: "{{ esxi_hostname }}"
    provisioning:
      ipv6_gateway: ::ffff:6440:301

Return Values

Common return values are documented here, the following are the fields unique to this module:

Key

Description

default

dictionary

dict of the TCP/IP stack configuration of the default.

Returned: always

Sample: “{\n \”alternate_dns\”: \”192.168.20.1\”,\n \”congestion_algorithm\”: \”cubic\”,\n \”domain\”: \”example.com\”,\n \”gateway\”: \”192.168.10.1\”,\n \”ipv6_gateway\”, null,\n \”hostname\”: \”esxi-test03\”,\n \”max_num_connections\”: 12000,\n \”preferred_dns\”: \”192.168.10.1\”,\n \”search_domains\”: [\n \”hoge.com\”,\n \”fuga.com\”\n ]\n}”

provisioning

dictionary

dict of the TCP/IP stack configuration of the provisioning.

Returned: always

Sample: “{\n \”congestion_algorithm\”: \”newreno\”,\n \”gateway\”: \”10.10.10.254\”,\n \”ipv6_gateway\”: null,\n \”max_num_connections\”: 12000\n}”

vmotion

dictionary

dict of the TCP/IP stack configuration of the vmotion.

Returned: always

Sample: “{\n \”congestion_algorithm\”: \”newreno\”,\n \”gateway\”: null,\n \”ipv6_gateway\”: null,\n \”max_num_connections\”: 11000\n}”

vxlan

dictionary

dict of the TCP/IP stack configuration of the vxlan.

Returned: always

Sample: “{\n \”congestion_algorithm\”: \”newreno\”,\n \”gateway\”: null,\n \”ipv6_gateway\”: null,\n \”max_num_connections\”: 11000\n}”

Authors

  • sky-joker (@sky-joker)