I was able to get this to work by using a packer.py (connection plugin)
however only one of my Tasks will work when running a playbook this way.
It's a task to create a local directory. Any other task, like to download a
file from s3 or run windows updates will fail with a generic error. I'm
guessing you must be limited in the tasks/ansible modules you can run from
Packer? or maybe there is something additional you need to add to make them
work?
On Thursday, April 4, 2019 at 12:26:26 PM UTC-7, gigit1000 wrote:
>
>
> Hello,
>
> I’m trying to use Packer to create a windows ami in aws with an Ansible
> provisioner and a Powershell provisioner. Without the Ansible provisioner
> my template works, but when I add the Ansible provisioner it fails with an
> authentication error: "msg": "Authentication or permission failure.
>
>
>
> I tried changing the position of the Ansible provisioner to run after the
> Powershell provisioner, in which case it fails with a different error:
> "msg": "failed to resolve remote temporary directory from
> ansible-tmp-1554400367
>
>
> I am very new to Packer. I’m I going about this wrong? Is it even possible
> to use two provisioners in the same template?
> thanks much for any help, my code is below:
>
>
>
> "provisioners": [
>
> {
>
> "type": "ansible",
>
> "playbook_file": "./play-win2016-base-v2-pack.yaml"
>
> },
>
> {
>
> "type": "powershell",
>
> "inline": [
>
>
> "C:\\ProgramData\\Amazon\\EC2-Windows\\Launch\\Scripts\\InitializeInstance.ps1
>
> -Schedule",
>
>
> "C:\\ProgramData\\Amazon\\EC2-Windows\\Launch\\Scripts\\SysprepInstance.ps1
> -NoShutdown"
>
> ]
>
> }
>
--
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/0e11031c-6405-4d0b-89ca-12b9058ef4f0%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.