> How do I get the IP?
Curl the metadata service on AWS, see
https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-instance-metadata.html#instancedata-data-retrieval

A example that used to work at least. Haven't tried it lately.
https://github.com/Diabol/packer-demo/blob/master/windows-cloud-ansible.json

> However, the special "packer" connection used by ansible provisioner it
requires a plugin, as far as I know, but that's where I get confused.

This is fairly well described in the docs:
https://packer.io/docs/provisioners/ansible.html#winrm-communicator

Maybe you can show what you have and what issue you are seeing.

On Tue, Aug 27, 2019, 00:48 Angel Rengifo Cancino <arengi...@gmail.com>
wrote:

>
> Hello Rickard, thanks for your reply
>
> On Mon, Aug 26, 2019 at 11:33 AM Rickard von Essen <
> rickard.von.es...@gmail.com> wrote:
>
>> To get the IP for running ansible in shell-local do:
>>
>> A) Run a shell provisioner that saves the IP in a file. Use a file
>> provisioner to download it and read it in the shell-local script.
>>
>  How do I get the IP? I'm not aware of any packer variable or setting that
> contains such value in a similar way as {{.WinRMPassword}} for password.
>
> Or B) use some aws tag specific to this build and run the aws cli to find
>> the IP of that instance.
>>
> That could be an option if option A does not work as expected.
>
>>
>> I would expect Ansible 2.8 with WinRM support in Packer to be at best
>> rocky. But if you are into troubleshooting things it's probably worth at
>> least trying.
>>
> Ansible 2.8 does work pretty well with WinRM. However, the special
> "packer" connection used by ansible provisioner it requires a plugin, as
> far as I know, but that's where I get confused.
>
> --
> This mailing list is governed under the HashiCorp Community Guidelines -
> https://www.hashicorp.com/community-guidelines.html. Behavior in
> violation of those guidelines may result in your removal from this mailing
> list.
>
> GitHub Issues: https://github.com/mitchellh/packer/issues
> IRC: #packer-tool on Freenode
> ---
> You received this message because you are subscribed to the Google Groups
> "Packer" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to packer-tool+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/packer-tool/CAA3McK95gj%3D73d_grifK-GLCG8suhcVVQ9Pz5%3D0Kevj9-1ahmA%40mail.gmail.com
> <https://groups.google.com/d/msgid/packer-tool/CAA3McK95gj%3D73d_grifK-GLCG8suhcVVQ9Pz5%3D0Kevj9-1ahmA%40mail.gmail.com?utm_medium=email&utm_source=footer>
> .
>

-- 
This mailing list is governed under the HashiCorp Community Guidelines - 
https://www.hashicorp.com/community-guidelines.html. Behavior in violation of 
those guidelines may result in your removal from this mailing list.

GitHub Issues: https://github.com/mitchellh/packer/issues
IRC: #packer-tool on Freenode
--- 
You received this message because you are subscribed to the Google Groups 
"Packer" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to packer-tool+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/packer-tool/CALz9Rt8i%3Da8jSDTNzj3LLC6-8BD6hN8eaD-6D7dGjppxOB9wRA%40mail.gmail.com.

Reply via email to