Hi - my team has an Ansible automation that deploys and configures a new 
Windows Server system in our vSphere-based lab environment. It uses govc to 
deploy an .ova created within our company that has a secure password for 
the 'administrator' account, and the 'administrator' account is set to 
force a password change on first login. I want to automate the password 
change in our Ansible workflow. After ova deployment, the network settings 
have not yet been applied.

I've tried using the vmware_vm_shell module with these values:

- name: "Set new administrator account password"
  local_action:
    module: vmware_vm_shell
    hostname: "{{ management_vcenter_ip }}"
    username: "{{ management_vcenter_user }}"
    password: "{{ management_vcenter_password }}"
    validate_certs: False
    datacenter: "{{ datacenter }}"
    vm_id: "{{ vm_name }}"
    vm_username: "{{ vm_admin }}"
    vm_password: "{{ vm_password  }}"
    vm_shell: 
"C:\\Windows\\System32\\WindowsPowershell\\v1.0\\powershell.exe"
    vm_shell_args: " -command Set-LocalUser -Name administrator -Password 
{{vm_new_password}}"
    vm_shell_cwd: "C:\\Windows\\Temp"

but am seeing this unhelpful response:

TASK [deploy-windowssql : Set new administrator account password] 
***************************************************************************************************************************
fatal: [ldpdd192.hop.lab.emc.com -> localhost]: FAILED! => {"changed": 
false, "msg": "A general system error occurred: vix error codes = (1, 
0).\n"}

Am I using vmware_vm_shell or the Powershell Set-LocalUser command 
incorrectly? Or is there a better way to change the 'administrator' 
password on a VM that is running but is not yet network-accessible?

Thanks!

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/c645b1a9-aa10-41ee-8c2b-a3edf1ac6e68n%40googlegroups.com.

Reply via email to