community.vmware.vmware_guest_serial_port – Manage serial ports on an existing VM
community.vmware.vmware_guest_serial_port – Manage serial ports on an existing VM
Note
This plugin is part of the community.vmware collection (version 1.6.0).
To install it use: ansible-galaxy collection install community.vmware
.
To use it in a playbook, specify: community.vmware.vmware_guest_serial_port
.
Synopsis
- This module can be used to manage serial ports on an existing VM
Parameters
Parameter | Choices/Defaults | Comments | |
---|---|---|---|
backings list / elements=dictionary / required |
A list of backings for serial ports.
| ||
backing_type string / required |
Backing type is required for the serial ports to be added or reconfigured or removed.
| ||
device_name string |
Serial device absolutely path. Required when backing_type=device. | ||
direction string |
|
The direction of the connection. Required when backing_type=network. | |
endpoint string |
|
When you use serial port pipe backing to connect a virtual machine to another process, you must define the endpoints. Required when backing_type=pipe. | |
file_path string |
File path for the host file used in this backing. Fully qualified path is required, like /. Required when backing_type=file. | ||
no_rx_loss boolean |
|
Enables optimized data transfer over the pipe. Required when backing_type=pipe. | |
pipe_name string |
Pipe name for the host pipe. Required when backing_type=pipe. | ||
service_uri string |
Identifies the local host or a system on the network, depending on the value of direction. If you use the virtual machine as a server, the URI identifies the host on which the virtual machine runs. In this case, the host name part of the URI should be empty, or it should specify the address of the local host. If you use the virtual machine as a client, the URI identifies the remote system on the network. Required when backing_type=network. | ||
state string |
|
If If If an existing serial port to modify or remove, | |
yield_on_poll boolean |
|
Enables CPU yield behavior. | |
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 Environment variable support added in Ansible 2.6. | ||
moid string |
Managed Object ID of the instance to manage if known, this is a unique identifier only within a single vCenter instance. This is required if | ||
name string |
Name of the virtual machine. This is a required parameter, if parameter | ||
password string |
The password of the vSphere vCenter or ESXi server. If the value is not specified in the task, the value of environment variable Environment variable support added in Ansible 2.6.
| ||
port integer |
Default: 443 |
The port number of the vSphere vCenter or ESXi server. If the value is not specified in the task, the value of environment variable Environment variable support added in Ansible 2.6. | |
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 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 | ||
use_instance_uuid boolean |
|
Whether to use the VMware instance UUID rather than the BIOS UUID. | |
username string |
The username of the vSphere vCenter or ESXi server. If the value is not specified in the task, the value of environment variable Environment variable support added in Ansible 2.6.
| ||
uuid string |
UUID of the instance to manage the serial ports, this is VMware's unique identifier. This is a required parameter, if parameter | ||
validate_certs boolean |
|
Allows connection when SSL certificates are not valid. Set to If the value is not specified in the task, the value of environment variable Environment variable support added in Ansible 2.6. If set to |
Examples
# Create serial ports
- name: Create multiple serial ports with Backing type - network, pipe, device and file
community.vmware.vmware_guest_serial_port:
hostname: "{{ vcenter_hostname }}"
username: "{{ vcenter_username }}"
password: "{{ vcenter_password }}"
name: "test_vm1"
backings:
- type: 'network'
direction: 'client'
service_uri: 'tcp://6000'
yield_on_poll: True
- type: 'pipe'
pipe_name: 'serial_pipe'
endpoint: 'client'
- type: 'device'
device_name: '/dev/char/serial/uart0'
- type: 'file'
file_path: '[datastore1]/file1'
yield_on_poll: True
register: create_multiple_ports
# Modify existing serial port
- name: Modify Network backing type
community.vmware.vmware_guest_serial_port:
hostname: '{{ vcenter_hostname }}'
username: '{{ vcenter_username }}'
password: '{{ vcenter_password }}'
name: '{{ name }}'
backings:
- type: 'network'
state: 'present'
direction: 'server'
service_uri: 'tcp://6000'
delegate_to: localhost
# Remove serial port
- name: Remove pipe backing type
community.vmware.vmware_guest_serial_port:
hostname: '{{ vcenter_hostname }}'
username: '{{ vcenter_username }}'
password: '{{ vcenter_password }}'
name: '{{ name }}'
backings:
- type: 'pipe'
state: 'absent'
delegate_to: localhost
Return Values
Common return values are documented here, the following are the fields unique to this module:
Key | Returned | Description |
---|---|---|
serial_port_data dictionary |
always |
metadata about the virtual machine's serial ports after managing them
Sample: [{'backing_type': 'network', 'direction': 'client', 'service_uri': 'tcp://6000'}, {'backing_type': 'pipe', 'direction': 'server', 'pipe_name': 'serial pipe'}] |
Authors
- Anusha Hegde (@anusha94)
© 2012–2018 Michael DeHaan
© 2018–2019 Red Hat, Inc.
Licensed under the GNU General Public License version 3.
https://docs.ansible.com/ansible/2.10/collections/community/vmware/vmware_guest_serial_port_module.html