vmware_guest_custom_attribute_defs – Manage custom attributes definitions for virtual machine from VMWare
vmware_guest_custom_attribute_defs – Manage custom attributes definitions for virtual machine from VMWare
New in version 2.7.
Synopsis
- This module can be used to add and remove custom attributes definitions for the given virtual machine from VMWare.
Requirements
The below requirements are needed on the host that executes this module.
- python >= 2.6
- PyVmomi
Parameters
Parameter | Choices/Defaults | Comments |
---|---|---|
attribute_key - |
Name of the custom attribute definition. This is required parameter, if | |
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 version 2.6. | |
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 version 2.6.
| |
port integer added in 2.5 |
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 version 2.6. |
state - / required |
|
Manage definition of custom attributes. If set to If set to If set to If set to |
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 version 2.6.
| |
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 version 2.6. If set to |
Notes
Note
- Tested on vSphere 6.5
Examples
- name: Add VMWare Attribute Definition
vmware_guest_custom_attribute_defs:
hostname: "{{ vcenter_hostname }}"
username: "{{ vcenter_username }}"
password: "{{ vcenter_password }}"
state: present
attribute_key: custom_attr_def_1
delegate_to: localhost
register: defs
- name: Remove VMWare Attribute Definition
vmware_guest_custom_attribute_defs:
hostname: "{{ vcenter_hostname }}"
username: "{{ vcenter_username }}"
password: "{{ vcenter_password }}"
state: absent
attribute_key: custom_attr_def_1
delegate_to: localhost
register: defs
Return Values
Common return values are documented here, the following are the fields unique to this module:
Key | Returned | Description |
---|---|---|
custom_attribute_defs list |
always |
list of all current attribute definitions
Sample: ['sample_5', 'sample_4'] |
Status
- This module is not guaranteed to have a backwards compatible interface. [preview]
- This module is maintained by the Ansible Community. [community]
Authors
- Jimmy Conner
- Abhijeet Kasurde (@Akasurde)
© 2012–2018 Michael DeHaan
© 2018–2019 Red Hat, Inc.
Licensed under the GNU General Public License version 3.
https://docs.ansible.com/ansible/2.7/modules/vmware_guest_custom_attribute_defs_module.html