VMware {code} Community
jacksonp2008
Contributor
Contributor

ansible "vmware_guest" module not able to set customvalues like remotedisplay.vnc.port

We are using ansible with the vmware_guest module, attempting to set customvalues with vSphere 6.5

##### ANSIBLE VERSION

ansible 2.4.0.0

  config file = /Users/spollock/ansible/fs-vmw-control/ansible.cfg

  configured module search path = [u'/Users/spollock/.ansible/plugins/modules', u'/usr/share/ansible/plugins/modules']

  ansible python module location = /Library/Python/2.7/site-packages/ansible

  executable location = /usr/local/bin/ansible

  python version = 2.7.10 (default, Oct 23 2015, 19:19:21) [GCC 4.2.1 Compatible Apple LLVM 7.0.0 (clang-700.0.59.5)]

##### SUMMARY

customvalues are not added, vSphere responds with : " A specified parameter was not correct: key"

##### SAMPLE PLAYBOOK

- name: Set a custom value

  vmware_guest:

    validate_certs: no

    hostname: "{{ vcenterhostname }}"

    username: "{{ vcusername }}"

    password: "{{ vcpassword }}"

    datacenter: "{{ vcdatacenter }}"

    cluster: "{{ vccluster }}"

    resource_pool: "k{{ vctargetkit }}"

    uuid: 422bf5cb-b3b2-69ab-4053-21bcf7390d23

    name: 1201-pollockkit

    customvalues:

      - key: remotedisplay.vnc.port

        value: "7601"

    #state: poweredoff

  delegate_to: localhost

##### ERROR MESSAGE

"msg": "Failed to set custom value for key='remotedisplay.vnc.port' and value='7601'. Error was: (vmodl.fault.InvalidArgument) {\n   dynamicType = <unset>,\n   dynamicProperty = (vmodl.DynamicProperty) [],\n   msg = 'A specified parameter was not correct: key',\n   faultCause = <unset>,\n   faultMessage = (vmodl.LocalizableMessage) [],\n   invalidProperty = u'key'\n}"

0 Kudos
0 Replies