I have been using the Packer pipeline to create a customized windows AMI from Amazon’s AMI as source. using amzon-ebs provider.
Letting packer to create a temporary key pair,
and using Administrator as the user and Auto generated password “{{.WinRMPassword}}” for rest of the packer pipeline.
after instance creation we are using ansible playbook to apply a full set of customization,
in the recent times , we see that
"Credentials rejected " message while playbook execution.
after multiple trials , 4 to 6 times of retires.
credentials are accepted and playbook is getting executed.
The only thing that came to mind for me what that you were populating a variable when you login to see if it worked, then it uses that to work after that. wierd one.
Depending on what kind machine is building and how busy things are the time to get a wimrn server up might change. Could also be that you downsized the image and things are slightly slower.