I have a playbook in which I want to create a random password and use it later to connect to a windows box over WinRM
I’ve generated a random password like this:
- name: Generate a temporary random password for new host
set_fact:
randopass: “{{ lookup(‘password’, ‘/dev/null length=15 chars=ascii_letters’) }}”
I set the admin password with vmware_guest os customization:
customization:
password: ‘{{ randopass }}’
timezone: 004
Then - I’m trying to use:
- hosts: ‘hostname.internal.domain.com’
connection: winrm
port: 5985
remote_user: Administrator
remote_pass: ‘{{ randopass }}’
gather_facts: yes
I’ve tried “remote_password, remote_pass, ansible_pass, ansible_password” and I get an error message like this:
ERROR! ‘remote_pass’ is not a valid attribute for a Play
What can I use for this part of the play to connect as a different user/password?
I’m using ansible tower if it matters