community.vmware.vmware_guest_custom_attribute_defs – Manage custom attributes definitions for virtual machine from VMware¶
Note
This plugin is part of the community.vmware collection (version 1.7.0).
To install it use: ansible-galaxy collection install community.vmware
.
To use it in a playbook, specify: community.vmware.vmware_guest_custom_attribute_defs
.
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¶
Examples¶
- name: Add VMware Attribute Definition
community.vmware.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
community.vmware.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
/ elements=string
|
always |
list of all current attribute definitions
Sample:
['sample_5', 'sample_4']
|
Authors¶
Jimmy Conner (@cigamit)
Abhijeet Kasurde (@Akasurde)