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"
]
}