Using external shell script file worked for me. Refer - Permission denied on shell script provisioner - #4 by tbugfinder