If you are using the ansible provisioner you should not have to care about how ansible connects to the ec2. Also you should use another inventory, packer will create a inventory with the correct settings. Can you post your template, at least the config for the ansible provision and I can verify it.
On Wed, Nov 28, 2018 at 7:15 AM Marchenm <[email protected]> wrote: > I've configured the amazon-ebs builder to use "ssh_keypair_name" and > "ssh_private_key_file" when starting the ec2 instance. When the Ansbile > remote provisioner runs with custom inventory (ec2.py) ssh doesn't work. If > I run packer with "-on-error=abort" im able to run ansible-playbook with -e > ansible_ssh_private_key_file=path/to/file.pem the ansible run works > successfully. > > -- > 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 [email protected]. > To view this discussion on the web visit > https://groups.google.com/d/msgid/packer-tool/eaa2869c-c0b3-44d2-82f3-3090b0b8bff8%40googlegroups.com > <https://groups.google.com/d/msgid/packer-tool/eaa2869c-c0b3-44d2-82f3-3090b0b8bff8%40googlegroups.com?utm_medium=email&utm_source=footer> > . > For more options, visit https://groups.google.com/d/optout. > -- 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 [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/packer-tool/CALz9Rt8TD1oP%3DZ7fu2YNksqv1JGPjCPYMCRp6dF5AuSxyMBSzg%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
