ssl: the specified credentials were rejected by the server (packer + windows + ansible)

32 views
Skip to first unread message

Gerrit Johannsen

unread,
Jan 9, 2020, 4:03:11 AM1/9/20
to Packer
Hi,

I know that the ansible provisioner is only community supported, so hoping for help here.
I'm using packer to build a windows server image and winrm is working fine using these commands in the userdata to setup winrm:
(New-Object System.Net.WebClient).DownloadFile('https://raw.githubusercontent.com/ansible/ansible/devel/examples/scripts/ConfigureRemotingForAnsible.ps1', 'c:\ConfigureRemotingForAnsible.ps1');
iex "c:\ConfigureRemotingForAnsible.ps1 -SkipNetworkProfileCheck -ForceNewSSLCert"

After it does some configuration without issues, so winrm seems fine for packer.
Now I want to run an ansible playbook to configure more software and start tests.
This is the provisioner:
      {
       "type": "ansible",
       "playbook_file":
         "tasks/install_software.yml",
       "user": "Administrator",
       "extra_arguments": [
       "--connection", "packer",
       "-vvv",
       "--extra-vars", "ansible_shell_type=powershell ansible_shell_executable=None ansible_password={{ .WinRMPassword }}"
       ]
     },

I have the packer.py connection plugin in a directory next to the playbook.
This is the error message I receive:
ssl: the specified credentials were rejected by the server

Let me know if I can provide more details or help with testing.

Thank you for your help!
Reply all
Reply to author
Forward
0 new messages