Fatal: [localhost]: FAILED! => changed=false msg: 'Unsupported parameters for (vmware_guest) module: customization.wait_for_customization

anybody know what would cause this error?

Can you provide the task where you are using that module?

Without seeing your task and taking a look at the docs and some playbooks where I use this, wait_for_customization is not a parameter for customization hence the error.

community.vmware.vmware_guest module

Here is an example of a task that I use :

- name: Clone a virtual machine from a windows template and customize
  community.vmware.vmware_guest:
    hostname: '{{ TGT_VCENTER_HOSTNAME }}'
    username: '{{ priv_user }}'
    password: '{{  priv_user_password  }}'
    validate_certs: true
    state: powered-on
    folder: '{{ TGT_VCENTER_FOLDER }}'
    template: '{{ TEMPLATE_NAME }}'
    datastore: '{{ TGT_VCENTER_DATASTORE }}'
    datacenter: '{{ TGT_VCENTER_DATACENTER }}'
    name: '{{ TGT_HOSTNAME }}'
    cluster: '{{ TGT_VCENTER_CLUSTER }}'
    networks:
      - name: '{{ TGT_NETWORK_NAME }}'
        ip: '{{ TGT_IP }}'
        netmask: '{{ TGT_NETMASK }}'
        gateway: '{{ TGT_GATEWAY }}'
        connected: true
        start_connected: true
    wait_for_ip_address: true
    wait_for_ip_address_timeout: 600
    wait_for_customization: true
    wait_for_customization_timeout: 300
    customization:
      domain: '{{ TGT_DOMAIN }}'
      domainadmin: '{{ priv_user }}'
      domainadminpassword: '{{  priv_user_password  }}'
      joindomain: '{{ TGT_DOMAIN }}'
      hostname: '{{ TGT_HOSTNAME }}'
      existing_vm: true
      dns_servers:
        - 192.11.11.19
        - 192.12.11.19
      dns_suffix:
        - '{{ TGT_DOMAIN }}'
  delegate_to: localhost
  register: build_task

Sad thing is… I know nothing about this stuff. The person that set this up has retired and we got this from support which was no help.

All this task does is create a new windows 2019 server and joins it to the domain and whatever small tasks included with that.

https://docs.ansible.com/ansible/latest/collections/community/vmware/vmware_guest_module.html

Well if you would like to provide the playbook or task here we can take a look and give some feedback.

Ultimately you will need to start doing some reading/testing on Ansible if you are going to be using / supporting it :slight_smile: There is a Documentation link under Community Links which will be helpful. There are tons of resources out there to get you started.

Its really not that hard to get started using it, you just need to start playing around and experimenting with it.

1 Like

This email sent from outside the District of Saanich. Use caution if message is unexpected or sender is not known to you.

[https://avatars.discourse-cdn.com/v4/letter/v/da6949/45.png]

Vince6Ghttps://urldefense.com/v3/__https:/forum.ansible.com/u/vince6g__;!!OmjNhHcnjQ!F8wbcpbvmkIe0Pp5ffwMG_mT__NSWHRyYkRC61Ct-dJx7zPCxAiIaFeiXiayzJVWsPO9fxHr9Qffky98zd9ERdTPIgoDBT-JpNBf4XM$ Vince
April 30

Can you provide the task where you are using that module?

(Attachment playbook.docx is missing)

doesn’t want me to have embedded emails??? and i can’t send attachments.

Adding that second line "community.vmware.vmware_guest. just created a whole whack of errors. I tried that yesterday.

Try just copying the text of the playbook into the post directly and add three backtick/grave accent before and after the playbook to turn it into a code block.

name: Create a new Virtual Server from a template
  hosts: localhost
  gather_facts: no
  vars:
# variables in the next 2 sections will be used in tasks and e-mails
# the next 3 lines will be text for the note field in vCenter for the new server
# -----------------------------------------------------------------------------
    myvmnotefield:  "Ansible - VM Created from template {{ myvmtemplate }} .
                     test .
                     Creation Date: April 23, 2024 "
    myservername:   "dt-test"             # requested new SERVER Hostname
    myserverip:     "x.x.x.x"            # new SERVER IP and STATS
    mydatastore:    "AX1-DS4"                  # suggested datastore for new VM (Simplivity Backup policy enabled)
 # -----------------------------------------------------------------------------
    mynetadapter:   "dvVM Network"             # win or dmz adapter
    mynetmask:      " x.x.x.x "
    mygateway:      " x.x.x.x "
    mydnsserv1:     " x.x.x.x "
    mydnsserv2:     " x.x.x.x "
    mydnsserv3:     "x.x.x.x"
    mywindomain:    "xxxxx"
    mydmzdomain:    "xxxxxx"
    myansibleuser:  "xxxxxx"        # Domain User put in ./administrator group to run windows patch plays
    mydomainadmin:  "xxxxx"           # Domain admin account used to join VM to AD, see Customization section for password
    myvcenteradmin: "xxxxxxxr"      # vCenter Administrator Role
    myvcenterhost:  "xxxxxxxx" # xxxxxx1 vcenter_ip x.x.x.x
    myvmdatacenter: "xxxxxx"              # DataCenter
    myvmcluster:    "xxxxxx"      # x Cluster
    myvmtemplate:   "TMPL_W2019"               # Template, not the Content Library OVA
    myvmfolder:     "Servers/FileServers"      # vcenter folder to place new VM
# -----------------------------------------------------------------------------
  tasks:
  - name: Save the VM create date in a variable.
    set_fact: creationdate="{{ lookup('pipe','date "+%m/%d/%Y %H:%M"') }}"
  - name: Clone VM from template, config NIC, Join Domain
    vmware_guest:
      hostname: "{{ myvcenterhost }}"          # vcenter_ip to host new VM
      username: "{{ myvcenteradmin }}"         # vcenter_username with admin to create VM's
      password: !vault |
          $ANSIBLE_VAULT;1.1;AES256
          
      validate_certs: No
      datacenter: "{{ myvmdatacenter }}"
      cluster: "{{ myvmcluster }}"
      datastore: "{{ mydatastore }}"
      name: "{{ myservername }}"               # new VM's display name in vCenter
      annotation: "{{ myvmnotefield }} {{ creationdate }}"     # vCenter VM Note field comments
      template: "{{ myvmtemplate }}"
      folder: "{{ myvmfolder }}"               # location to store new VM
      state: poweredon
      wait_for_ip_address: yes
# -----------------------------------------------------------------------------
      networks:
        - name: "{{ mynetadapter }}"
          ip: "{{ myserverip }}"               # nev VM's Static Network defined
          netmask: "{{ mynetmask }}"
          gateway: "{{ mygateway }}"
          dns_servers:
            - "{{ mydnsserv1 }}"
            - "{{ mydnsserv2 }}"
            - "{{ mydnsserv3 }}"
          type: static
          start_connected: yes
          wait_for_ip_address: yes
# -----------------------------------------------------------------------------
      customization:
        timezone: 004                         # VMware docs Pacific Standard
        fullname:                # VM localhost Administrator
        password: !vault |
          $ANSIBLE_VAULT;1.1;AES256
          
        runonce:
        - powershell.exe Add-LocalGroupMember -Group "Administrators" -Member "SVC_ansible_local"
        - powershell.exe Add-LocalGroupMember -Group "Administrators" -Member "OpsAdmin"
        - powershell.exe Set-NetFirewallProfile -Profile Domain,Public,Private -Enabled False
        - powershell.exe $adapters=(gwmi win32_networkadapterconfiguration );
            Foreach ($adapter in $adapters) { Write-Host $adapter;
            $adapter.settcpipnetbios(1) }
        - powershell.exe write-host "`n";write-host "`n";write-host "`n";
            $ask4VMDesc=Read-Host -Prompt 'Enter a few words that describe what this server does ';
            $myVMDesc=Get-WmiObject -class Win32_OperatingSystem;
            $myVMDesc.Description=$ask4VMDesc;
            $myVMDesc.put()
                                               # the previous 4 Powershell statements add SVC_ansible_local & OpsAdmin
                                               # to local administrators group on the New VM
                                               # turn off the domain, public, and private firewalls
                                               # turn on Enable NetBios over TCP/IP on the NIC in the WINS settings
                                               # ask the 1st tk_loginuser to provide a description of this server for
                                               # the System Properties destription field.
        dns_suffix:
          - "{{ mywindomain }}"
          - "{{ mydmzdomain }}"
        hostname: "{{ myservername }}"        # during customization this is the Windows Hostname
        joindomain: "{{ mywindomain }}"
        domainadmin: "{{ mydomainadmin }}"    # see the Vars: section for the Domain_Admin
        domainadminpassword: !vault |
              $ANSIBLE_VAULT;1.1;AES256
              
        wait_for_customization: yes

To me it looks like your wait parameters need to be at the same indentation level as say networks and customization. See how items under customization are 2 spaces in , those are valid for customization. The wait parameters is not. Look at the example I provided earlier and see what level of indentation those parameters are listed. The order is not as important but the level of indentation is.

wait_for_ip_address:
wait_for_customization: 

Look at the docs for the module:
vmware_guest_module

If you look at say customization you can only have those items that are listed for that indented under it. Same for networks etc.

You will need to review YAML syntax as well or you will have a world of problems:
YAML Syntax

Hopefully I was able to explain it well enough to get you going. Try moving those items and let us know how it goes , good luck!