【发布时间】:2021-05-13 17:33:39
【问题描述】:
我是打包机新手。我听说您可以添加一个 vagrant 后处理器来为您提供一个简单的 VM 来测试您的新图像。基于示例等,我认为下面的代码可以工作。但是,我收到此错误。
* Post-processor failed: ovf file couldn't be found
这是我的打包程序配置/代码。
source "digitalocean" "test" {
image = "ubuntu-20-10-x64"
region = "nyc1"
size = "s-1vcpu-1gb"
snapshot_name = "me-image-{{isotime \"2006-01-02T15:04\"}}"
snapshot_regions = [
"nyc1", "sgp1", "lon1", "nyc3", "ams3", "fra1", "tor1", "sfo2", "blr1",
"sfo3"
]
tags = ["delete"]
ssh_username = "root"
}
# a build block invokes sources and runs provisioning steps on them.
build {
sources = ["source.digitalocean.test"]
provisioner "file" {
source = "jump_host"
destination = "/tmp"
}
post-processor "vagrant" {
keep_input_artifact = true
provider_override = "virtualbox"
output = "out.box"
}
}
我的打包器版本是 1.6.6
我的流浪版本是 2.2.10
【问题讨论】:
-
似乎您可以删除
provider_override = "virtualbox"部分,Packer 将创建一个具有aws提供程序的框,而不是您必须为 aws 提供程序创建一个插件,这可能会起作用。 Vagrant 文件必须包含: Vagrant.configure("2") do |config| config.vm.provider :aws 做 |aws| aws.ami = "ami-7747d01e" end end
标签: vagrant virtualbox packer