Hello,
I asked a similar question
back in January, there wasn't any solution at that time, however, I'm hoping with the release of 1.0 there might be a way to support our workflow...
The short version is, we have a build pipeline in one datacenter that publishes OVAs to an Artifactory instance. Then at various datacenters throughout the country, another user pulls that OVA down, manually registers it, and then can use terraform to spin up instances from that template. Unfortunately, we can't just use the vsphere post processor from the packer that builds the OVA, as that build pipeline doesn't have reach into all the various data centers where the ova needs to be registered.
I don't know how else to describe it but, I'd like to run packer Post Processors without running any builders.
I tried this (I replaced the vsphere post-processor with the shasum for the purposes of testing, I figured if I can shasum I can upload):
{
"post-processors": [
{
"type": "artifice",
"files": "CentOS_7.4.1708-20171010.ova"
},
{
"type": "checksum",
"checksum_types": "sha256"
}
]
}
But as you might imagine, this fails with an error that you must create at least one builder... well, drat.
so my next attempt was the null resource, but that requires the ability to login to a VM via ssh... dealing with username and pass isn't something I really want to deal with... so I skipped onto the File resource, which looks promising! but...
{
"builders": [
{
"type": "file",
"target": "CentOS_7.4.1708-20171010.ova"
}
],
"post-processors": [
{
"type": "artifice",
"files": "CentOS_7.4.1708-20171010.ova"
},
{
"type": "checksum",
"checksum_types": "sha256"
}
]
}
This completely blanked my file! Doh! LOL, you can imagine my surprise!
I also tried:
export IMAGE=`cat CentOS_7.4.1708-20171010.ova
But this causes bash to have fits...
If there was just some way to say:
{
"builders": [
{
"type": "file",
"content": "./CentOS_7.4.1708-20171010.ova",
"target": "CentOS_7.4.1708-20171010.ova"
}
],
"post-processors": [
{
"type": "artifice",
"files": "CentOS_7.4.1708-20171010.ova"
},
{
"type": "checksum",
"checksum_types": "sha256"
}
]
}
This would solve my problem.
However, this puts literally the string "./CentOS_7.4.1708-20171010.ova" in my file.
Am I barking up the wrong tree here? I really don't want to go build a tool just to do the uploads especially since Packer already has the desired functionality... but I can't for the life of me figure out how to get packer to consume an existing artifact...
any thoughts?
Thanks,
Jon A