I am unsure exactly how i am supposed to handle and work with windows passwords when working with EC2 and inventories. I know i can query the passwords by using ec2_win_password, however i am unsure exactly how i can use this value to set the ansible_ssh_pass. For that connection.
For example:
`
hosts: windows
connection: local
gather_facts: false
tasks:
ec2_win_password:
`
Unfortunately this play will never work because all hosts in the windows group need to know their password. Manually defining all the windows passwords in hosts seems like a really really awful idea, but i am unsure exactly what i can do in this case. I can do a localhost play before this play to grab all the associated passwords using ec2_win_password, however that doesn’t actually fix anything because i can’t seem to find a way to set the ansible_ssh_pass fact using set_fact.
I am lost and tired. What exactly am i supposed to do?
You may also want to check out my win-ec2 role as an example of fetching the passwords, adding them to inventory and generating a static inventory file: