Feature: Add a new template or env variable like "{{ .WinRMPassword }}"
In the future: We recommend using shell-local to run Ansible, but doing so means users must first generate the temporary host file. In https://github.com/hashicorp/packer/issues/4904#issuecomment-349844919 a user requested being able to access the randomly-generated EC2 Windows password in order to be able to generate this file.
Will this be ansible specific? This would be super useful in the powershell
provisioner as well.
@matt-richardson good point; I'll remove the ansible tag from this issue.
See #3911 and #3969
https://github.com/hashicorp/packer/pull/4409 is probably the right approach here.
I have a similar request under https://github.com/hashicorp/packer/issues/5871 for oracle-oci i also know that alibaba and some openstack also have the random password generated at build - perhaps this should be an option for all providers?
@Marcus-James-Adams Agreed. Once we have the framework in place for AWS it shouldn't be too hard to enable it for other providers as well.
closed via #5998
This was at first open for the ansible
provisioner, and it ended fixed for the powershell
provisioner but not the ansible
, nor shell-local
ones. As stated in #5998 :
that issue won't be truly addressed until you can also access this variable from the shell-local provisioner
As shell-local
currently seems to be the recommanded way to call ansible, it should get this feature.
Please reopen.
Good point I've opened separate tickets for each place we implement this, just to keep scope clear. I'll change the title of this one to be specific to Powershell.
@liberforce if you'd like to test the patch enabling you to access the winrm password from the shell-local provisioner, check out #6251. I can build it for you if you let me know your host architecture.
@SwampDragons : sorry for the late reply, I was out of office for the passed month. Thanks for your proposal, I'll be happy to test a binary if you can still provide it. I'm running an x86_64 Ubuntu 14.04.
@liberforce you don't need a binary; this has been released and is in Packer 1.2.4
I'm going to lock this issue because it has been closed for _30 days_ โณ. This helps our maintainers find and focus on the active issues.
If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.
Most helpful comment
Good point I've opened separate tickets for each place we implement this, just to keep scope clear. I'll change the title of this one to be specific to Powershell.