Deprovision part executed for AWS too and result an Error

12 views
Skip to first unread message

Deking

unread,
Mar 15, 2019, 2:01:24 PM3/15/19
to Packer
Hi,

I have encounter issue.
Obviously there is no such as Azure  Linux Agent under AWS. But the point is to run packer from the same source code in parallel. AWS part and Azure is in the same packer json file. So Provisioner is executing the same scripts and commands for both Azure and AWS.
The question is how can i isolate this part of code to be just for Azure:

{
"execute_command": "chmod +x {{ .Path }}; {{ .Vars }} sudo -E sh '{{ .Path }}'",
"inline": [
"/usr/sbin/waagent -force -deprovision+user && export HISTSIZE=0 && sync"
],
"inline_shebang": "/bin/sh -x",
"type": "shell",
"skip_clean": true,
"pause_before": "5s"
}

ERROR:
amazon-ebs: /tmp/script_9362.sh: line 2: /usr/sbin/waagent: No such file or directory

==> amazon-ebs: Cleaning up any extra volumes...
==> amazon-ebs: Destroying volume (vol-03eec40b543b65765)...
==> amazon-ebs: Deleting temporary keypair...
Build 'amazon-ebs' errored: Script exited with non-zero exit status: 127

Deking

unread,
Mar 15, 2019, 2:12:19 PM3/15/19
to Packer
Think i've found solution: 

"only": ["azure-arm"]

Testing now.
Reply all
Reply to author
Forward
0 new messages