I am working on a template located here. In the provision section I have:
"provisioners": [
{
"type": "shell-local",
"command": "wget http://distfiles.gentoo.org/releases/amd64/autobuilds/{{user `stage3-date`}}/stage3-amd64-{{user `stage3-date`}}.tar.bz2"
},
{
"type": "file",
"source": "stage3-amd64-{{user `stage3-date`}}.tar.bz2",
"destination": "/root"
},
{
"destination": "/root",
"source": "scripts/",
"type": "file"
},
{
"environment_vars": [
"STAGE3={{user `stage3-date`}}"
],
"type": "shell",
"inline": ["cd /root", "chmod u+x provision.sh", "./provision.sh"]
}
]
My goal is to download the stage3 when needed, perform an md5 check, and move it to /root on the vm but that is not happening. (For those not familiar with gentoo this is the actually install files that need to be unpacked to the chrooted hd). This is the output.
john@g1 gentoo-packer $ packer build -debug gentoo64.json
Debug mode enabled. Builds will not be parallelized.
virtualbox-iso output will be in this color.
1 error(s) occurred:
* Bad source 'stage3-amd64-20150924.tar.bz2': stat stage3-amd64-20150924.tar.bz2: no such file or directory
It looks like packer is trying to run the "file" provisioners before "shell-local". Since packer is not going in the order of the provisioners array, is there any way to enforce order when the provisioners are run?
Note 1:
I'm pretty sure line 58 in the file provisioner is causing all of my issues. The files are checked when packer starts rather than when the provisioner runs. Since the file hasn't been downloaded yet it fails.