Closed tom-henderson closed 7 years ago
Looks like it :)
It's been a while since I've been in this space, but I do recall working on exit codes - it wasn't pretty!
I'd stick with your solution for now until we can set aside time to look at this. FWIW are you using these plugins or packer itself (they have been merged into Packer now, this issue may well be fixed there).
I have a PowerShell script that polls the state of the Local Configuration Manager and only proceeds when it's Idle. This block is inserted twice after the DSC config is applied to allow the machine complete the two reboots needed to complete the configuration.
With the above block the build fails with
Build 'amazon-ebs' errored: Script exited with non-zero exit status: 1. Allowed exit codes are: [0]
. I assume this is because the LCM initiates a reboot which forces my script to exit with a non-zero exit code:What's odd is if I add
"valid_exit_codes": [1]
to the above block, the build fails withBuild 'amazon-ebs' errored: Script exited with non-zero exit status: 0. Allowed exit codes are: [1]
.The only way I can get the build to succeed is to use
"valid_exit_codes": [0, 1]
.Is this a bug?