我已经试过了我能想到的所有方法,并拒绝在虚拟机上设置“自定义值”。
- name: Cloning VM vmware_guest: validate_certs: no hostname: "{{ vcenterhostname }}" username: "{{ vcusername }}" ... template: "{{ item.key }}" name: new_vm0001 customvalues: - remotedisplay.vnc.port: 6021 state: restarted when: - item.key | search('-sourcevm') with_dict: "{{ vmfacts.virtual_machines }}" delegate_to: localhost
有没有人能够成功地设置自定义值?
使用合理的2.4,我想这可能会被打破,但更有可能我没有正确的语法。
使用您最喜爱的search引擎来查找vmware_guest模块手册
读:
customvalues定义在虚拟机上设置的自定义值列表。
自定义对象需要2个字段的
key和value。
实行:
customvalues: - key: remotedisplay.vnc.port value: 6021