2021-03-05 15:44:04 -05:00
|
|
|
package command
|
|
|
|
|
|
|
|
import (
|
|
|
|
packersdk "github.com/hashicorp/packer-plugin-sdk/packer"
|
|
|
|
|
|
|
|
// Previously core-bundled components, split into their own plugins but
|
|
|
|
// still vendored with Packer for now. Importing as library instead of
|
|
|
|
// forcing use of packer init, until packer v1.8.0
|
2021-03-05 15:27:03 -05:00
|
|
|
exoscaleimportpostprocessor "github.com/exoscale/packer-plugin-exoscale/post-processor/exoscale-import"
|
2021-04-19 17:05:40 -04:00
|
|
|
alicloudecsbuilder "github.com/hashicorp/packer-plugin-alicloud/builder/ecs"
|
|
|
|
alicloudimportpostprocessor "github.com/hashicorp/packer-plugin-alicloud/post-processor/alicloud-import"
|
2021-03-25 08:37:48 -04:00
|
|
|
amazonchrootbuilder "github.com/hashicorp/packer-plugin-amazon/builder/chroot"
|
|
|
|
amazonebsbuilder "github.com/hashicorp/packer-plugin-amazon/builder/ebs"
|
|
|
|
amazonebssurrogatebuilder "github.com/hashicorp/packer-plugin-amazon/builder/ebssurrogate"
|
|
|
|
amazonebsvolumebuilder "github.com/hashicorp/packer-plugin-amazon/builder/ebsvolume"
|
|
|
|
amazoninstancebuilder "github.com/hashicorp/packer-plugin-amazon/builder/instance"
|
|
|
|
amazonamidatasource "github.com/hashicorp/packer-plugin-amazon/datasource/ami"
|
|
|
|
amazonsecretsmanagerdatasource "github.com/hashicorp/packer-plugin-amazon/datasource/secretsmanager"
|
|
|
|
anazibimportpostprocessor "github.com/hashicorp/packer-plugin-amazon/post-processor/import"
|
2021-04-16 10:31:09 -04:00
|
|
|
ansibleprovisioner "github.com/hashicorp/packer-plugin-ansible/provisioner/ansible"
|
|
|
|
ansiblelocalprovisioner "github.com/hashicorp/packer-plugin-ansible/provisioner/ansible-local"
|
2021-05-13 16:13:21 -04:00
|
|
|
azurearmbuilder "github.com/hashicorp/packer-plugin-azure/builder/azure/arm"
|
|
|
|
azurechrootbuilder "github.com/hashicorp/packer-plugin-azure/builder/azure/chroot"
|
|
|
|
azuredtlbuilder "github.com/hashicorp/packer-plugin-azure/builder/azure/dtl"
|
|
|
|
azuredtlartifactprovisioner "github.com/hashicorp/packer-plugin-azure/provisioner/azure-dtlartifact"
|
2021-04-20 12:25:19 -04:00
|
|
|
chefclientprovisioner "github.com/hashicorp/packer-plugin-chef/provisioner/chef-client"
|
|
|
|
chefsoloprovisioner "github.com/hashicorp/packer-plugin-chef/provisioner/chef-solo"
|
2021-04-19 19:57:58 -04:00
|
|
|
cloudstackbuilder "github.com/hashicorp/packer-plugin-cloudstack/builder/cloudstack"
|
2021-04-22 11:03:14 -04:00
|
|
|
convergeprovisioner "github.com/hashicorp/packer-plugin-converge/provisioner/converge"
|
2021-04-22 05:45:27 -04:00
|
|
|
digitaloceanbuilder "github.com/hashicorp/packer-plugin-digitalocean/builder/digitalocean"
|
|
|
|
digitaloceanimportpostprocessor "github.com/hashicorp/packer-plugin-digitalocean/post-processor/digitalocean-import"
|
2021-03-05 15:44:04 -05:00
|
|
|
dockerbuilder "github.com/hashicorp/packer-plugin-docker/builder/docker"
|
|
|
|
dockerimportpostprocessor "github.com/hashicorp/packer-plugin-docker/post-processor/docker-import"
|
|
|
|
dockerpushpostprocessor "github.com/hashicorp/packer-plugin-docker/post-processor/docker-push"
|
|
|
|
dockersavepostprocessor "github.com/hashicorp/packer-plugin-docker/post-processor/docker-save"
|
|
|
|
dockertagpostprocessor "github.com/hashicorp/packer-plugin-docker/post-processor/docker-tag"
|
2021-04-19 05:10:15 -04:00
|
|
|
googlecomputebuilder "github.com/hashicorp/packer-plugin-googlecompute/builder/googlecompute"
|
|
|
|
googlecomputeexportpostprocessor "github.com/hashicorp/packer-plugin-googlecompute/post-processor/googlecompute-export"
|
|
|
|
googlecomputeimportpostprocessor "github.com/hashicorp/packer-plugin-googlecompute/post-processor/googlecompute-import"
|
2021-04-22 08:52:07 -04:00
|
|
|
hcloudbuilder "github.com/hashicorp/packer-plugin-hcloud/builder/hcloud"
|
2021-04-21 09:08:38 -04:00
|
|
|
hyperonebuilder "github.com/hashicorp/packer-plugin-hyperone/builder/hyperone"
|
2021-04-21 10:32:34 -04:00
|
|
|
hypervisobuilder "github.com/hashicorp/packer-plugin-hyperv/builder/hyperv/iso"
|
|
|
|
hypervvmcxbuilder "github.com/hashicorp/packer-plugin-hyperv/builder/hyperv/vmcx"
|
2021-04-21 10:55:41 -04:00
|
|
|
jdcloudbuilder "github.com/hashicorp/packer-plugin-jdcloud/builder/jdcloud"
|
|
|
|
linodebuilder "github.com/hashicorp/packer-plugin-linode/builder/linode"
|
2021-04-22 08:21:23 -04:00
|
|
|
lxcbuilder "github.com/hashicorp/packer-plugin-lxc/builder/lxc"
|
|
|
|
lxdbuilder "github.com/hashicorp/packer-plugin-lxd/builder/lxd"
|
2021-04-20 09:09:11 -04:00
|
|
|
ncloudbuilder "github.com/hashicorp/packer-plugin-ncloud/builder/ncloud"
|
2021-05-25 08:30:03 -04:00
|
|
|
oneandonebuilder "github.com/hashicorp/packer-plugin-oneandone/builder/oneandone"
|
2021-04-19 19:06:00 -04:00
|
|
|
openstackbuilder "github.com/hashicorp/packer-plugin-openstack/builder/openstack"
|
2021-04-22 05:50:00 -04:00
|
|
|
oracleclassicbuilder "github.com/hashicorp/packer-plugin-oracle/builder/classic"
|
|
|
|
oracleocibuilder "github.com/hashicorp/packer-plugin-oracle/builder/oci"
|
2021-04-20 11:18:45 -04:00
|
|
|
oscbsubuilder "github.com/hashicorp/packer-plugin-outscale/builder/osc/bsu"
|
|
|
|
oscbsusurrogatebuilder "github.com/hashicorp/packer-plugin-outscale/builder/osc/bsusurrogate"
|
|
|
|
oscbsuvolumebuilder "github.com/hashicorp/packer-plugin-outscale/builder/osc/bsuvolume"
|
|
|
|
oscchrootbuilder "github.com/hashicorp/packer-plugin-outscale/builder/osc/chroot"
|
2021-04-20 11:46:42 -04:00
|
|
|
parallelsisobuilder "github.com/hashicorp/packer-plugin-parallels/builder/parallels/iso"
|
|
|
|
parallelspvmbuilder "github.com/hashicorp/packer-plugin-parallels/builder/parallels/pvm"
|
2021-04-20 08:59:34 -04:00
|
|
|
proxmoxclone "github.com/hashicorp/packer-plugin-proxmox/builder/proxmox/clone"
|
|
|
|
proxmoxiso "github.com/hashicorp/packer-plugin-proxmox/builder/proxmox/iso"
|
2021-04-20 13:44:31 -04:00
|
|
|
puppetmasterlessprovisioner "github.com/hashicorp/packer-plugin-puppet/provisioner/puppet-masterless"
|
|
|
|
puppetserverprovisioner "github.com/hashicorp/packer-plugin-puppet/provisioner/puppet-server"
|
2021-04-19 10:32:04 -04:00
|
|
|
qemubuilder "github.com/hashicorp/packer-plugin-qemu/builder/qemu"
|
2021-04-20 11:59:59 -04:00
|
|
|
scalewaybuilder "github.com/hashicorp/packer-plugin-scaleway/builder/scaleway"
|
2021-04-22 09:21:34 -04:00
|
|
|
tencentcloudcvmbuilder "github.com/hashicorp/packer-plugin-tencentcloud/builder/tencentcloud/cvm"
|
2021-04-22 08:06:30 -04:00
|
|
|
tritonbuilder "github.com/hashicorp/packer-plugin-triton/builder/triton"
|
2021-04-21 13:25:04 -04:00
|
|
|
uclouduhostbuilder "github.com/hashicorp/packer-plugin-ucloud/builder/ucloud/uhost"
|
|
|
|
ucloudimportpostprocessor "github.com/hashicorp/packer-plugin-ucloud/post-processor/ucloud-import"
|
2021-04-21 16:31:28 -04:00
|
|
|
vagrantbuilder "github.com/hashicorp/packer-plugin-vagrant/builder/vagrant"
|
|
|
|
vagrantpostprocessor "github.com/hashicorp/packer-plugin-vagrant/post-processor/vagrant"
|
|
|
|
vagrantcloudpostprocessor "github.com/hashicorp/packer-plugin-vagrant/post-processor/vagrant-cloud"
|
2021-04-16 11:38:02 -04:00
|
|
|
virtualboxisobuilder "github.com/hashicorp/packer-plugin-virtualbox/builder/virtualbox/iso"
|
|
|
|
virtualboxovfbuilder "github.com/hashicorp/packer-plugin-virtualbox/builder/virtualbox/ovf"
|
|
|
|
virtualboxvmbuilder "github.com/hashicorp/packer-plugin-virtualbox/builder/virtualbox/vm"
|
2021-04-19 08:28:48 -04:00
|
|
|
vmwareisobuilder "github.com/hashicorp/packer-plugin-vmware/builder/vmware/iso"
|
|
|
|
vmwarevmxbuilder "github.com/hashicorp/packer-plugin-vmware/builder/vmware/vmx"
|
2021-04-09 11:58:56 -04:00
|
|
|
vsphereclonebuilder "github.com/hashicorp/packer-plugin-vsphere/builder/vsphere/clone"
|
|
|
|
vsphereisobuilder "github.com/hashicorp/packer-plugin-vsphere/builder/vsphere/iso"
|
|
|
|
vspherepostprocessor "github.com/hashicorp/packer-plugin-vsphere/post-processor/vsphere"
|
|
|
|
vspheretemplatepostprocessor "github.com/hashicorp/packer-plugin-vsphere/post-processor/vsphere-template"
|
2021-04-22 11:03:14 -04:00
|
|
|
yandexbuilder "github.com/hashicorp/packer-plugin-yandex/builder/yandex"
|
|
|
|
yandexexportpostprocessor "github.com/hashicorp/packer-plugin-yandex/post-processor/yandex-export"
|
|
|
|
yandeximportpostprocessor "github.com/hashicorp/packer-plugin-yandex/post-processor/yandex-import"
|
2021-03-05 15:44:04 -05:00
|
|
|
)
|
|
|
|
|
2021-03-25 08:37:48 -04:00
|
|
|
// VendoredDatasources are datasource components that were once bundled with the
|
|
|
|
// Packer core, but are now being imported from their counterpart plugin repos
|
|
|
|
var VendoredDatasources = map[string]packersdk.Datasource{
|
|
|
|
"amazon-ami": new(amazonamidatasource.Datasource),
|
|
|
|
"amazon-secretsmanager": new(amazonsecretsmanagerdatasource.Datasource),
|
|
|
|
}
|
|
|
|
|
2021-03-05 19:07:32 -05:00
|
|
|
// VendoredBuilders are builder components that were once bundled with the
|
|
|
|
// Packer core, but are now being imported from their counterpart plugin repos
|
2021-03-05 15:44:04 -05:00
|
|
|
var VendoredBuilders = map[string]packersdk.Builder{
|
2021-04-19 17:05:40 -04:00
|
|
|
"alicloud-ecs": new(alicloudecsbuilder.Builder),
|
2021-03-25 08:37:48 -04:00
|
|
|
"amazon-ebs": new(amazonebsbuilder.Builder),
|
|
|
|
"amazon-chroot": new(amazonchrootbuilder.Builder),
|
|
|
|
"amazon-ebssurrogate": new(amazonebssurrogatebuilder.Builder),
|
|
|
|
"amazon-ebsvolume": new(amazonebsvolumebuilder.Builder),
|
|
|
|
"amazon-instance": new(amazoninstancebuilder.Builder),
|
2021-05-13 16:13:21 -04:00
|
|
|
"azure-arm": new(azurearmbuilder.Builder),
|
|
|
|
"azure-chroot": new(azurechrootbuilder.Builder),
|
|
|
|
"azure-dtl": new(azuredtlbuilder.Builder),
|
2021-04-19 19:57:58 -04:00
|
|
|
"cloudstack": new(cloudstackbuilder.Builder),
|
2021-04-22 05:45:27 -04:00
|
|
|
"digitalocean": new(digitaloceanbuilder.Builder),
|
2021-04-19 11:05:21 -04:00
|
|
|
"docker": new(dockerbuilder.Builder),
|
2021-04-19 05:10:15 -04:00
|
|
|
"googlecompute": new(googlecomputebuilder.Builder),
|
2021-04-22 08:52:07 -04:00
|
|
|
"hcloud": new(hcloudbuilder.Builder),
|
2021-04-21 10:32:34 -04:00
|
|
|
"hyperv-iso": new(hypervisobuilder.Builder),
|
|
|
|
"hyperv-vmcx": new(hypervvmcxbuilder.Builder),
|
|
|
|
"hyperone": new(hyperonebuilder.Builder),
|
2021-04-21 10:55:41 -04:00
|
|
|
"jdcloud": new(jdcloudbuilder.Builder),
|
|
|
|
"linode": new(linodebuilder.Builder),
|
2021-04-22 08:21:23 -04:00
|
|
|
"lxc": new(lxcbuilder.Builder),
|
|
|
|
"lxd": new(lxdbuilder.Builder),
|
2021-04-20 09:09:11 -04:00
|
|
|
"ncloud": new(ncloudbuilder.Builder),
|
2021-05-25 08:30:03 -04:00
|
|
|
"oneandone": new(oneandonebuilder.Builder),
|
2021-04-19 19:06:00 -04:00
|
|
|
"openstack": new(openstackbuilder.Builder),
|
2021-04-22 05:50:00 -04:00
|
|
|
"oracle-classic": new(oracleclassicbuilder.Builder),
|
|
|
|
"oracle-oci": new(oracleocibuilder.Builder),
|
2021-04-20 08:59:34 -04:00
|
|
|
"proxmox": new(proxmoxiso.Builder),
|
|
|
|
"proxmox-iso": new(proxmoxiso.Builder),
|
|
|
|
"proxmox-clone": new(proxmoxclone.Builder),
|
2021-04-20 11:46:42 -04:00
|
|
|
"parallels-iso": new(parallelsisobuilder.Builder),
|
|
|
|
"parallels-pvm": new(parallelspvmbuilder.Builder),
|
2021-04-19 10:32:04 -04:00
|
|
|
"qemu": new(qemubuilder.Builder),
|
2021-04-20 11:59:59 -04:00
|
|
|
"scaleway": new(scalewaybuilder.Builder),
|
2021-04-22 09:21:34 -04:00
|
|
|
"tencentcloud-cvm": new(tencentcloudcvmbuilder.Builder),
|
2021-04-22 08:06:30 -04:00
|
|
|
"triton": new(tritonbuilder.Builder),
|
2021-04-21 13:25:04 -04:00
|
|
|
"ucloud-uhost": new(uclouduhostbuilder.Builder),
|
2021-04-21 16:31:28 -04:00
|
|
|
"vagrant": new(vagrantbuilder.Builder),
|
2021-04-09 11:58:56 -04:00
|
|
|
"vsphere-clone": new(vsphereclonebuilder.Builder),
|
|
|
|
"vsphere-iso": new(vsphereisobuilder.Builder),
|
2021-04-16 11:38:02 -04:00
|
|
|
"virtualbox-iso": new(virtualboxisobuilder.Builder),
|
|
|
|
"virtualbox-ovf": new(virtualboxovfbuilder.Builder),
|
|
|
|
"virtualbox-vm": new(virtualboxvmbuilder.Builder),
|
2021-04-19 08:28:48 -04:00
|
|
|
"vmware-iso": new(vmwareisobuilder.Builder),
|
|
|
|
"vmware-vmx": new(vmwarevmxbuilder.Builder),
|
2021-04-20 11:18:45 -04:00
|
|
|
"osc-bsu": new(oscbsubuilder.Builder),
|
|
|
|
"osc-bsusurrogate": new(oscbsusurrogatebuilder.Builder),
|
|
|
|
"osc-bsuvolume": new(oscbsuvolumebuilder.Builder),
|
|
|
|
"osc-chroot": new(oscchrootbuilder.Builder),
|
2021-04-22 11:03:14 -04:00
|
|
|
"yandex": new(yandexbuilder.Builder),
|
2021-03-05 15:44:04 -05:00
|
|
|
}
|
|
|
|
|
2021-03-05 19:07:32 -05:00
|
|
|
// VendoredProvisioners are provisioner components that were once bundled with the
|
|
|
|
// Packer core, but are now being imported from their counterpart plugin repos
|
2021-04-16 10:31:09 -04:00
|
|
|
var VendoredProvisioners = map[string]packersdk.Provisioner{
|
2021-05-13 16:13:21 -04:00
|
|
|
"azure-dtlartifact": new(azuredtlartifactprovisioner.Provisioner),
|
2021-04-20 13:44:31 -04:00
|
|
|
"ansible": new(ansibleprovisioner.Provisioner),
|
|
|
|
"ansible-local": new(ansiblelocalprovisioner.Provisioner),
|
|
|
|
"chef-client": new(chefclientprovisioner.Provisioner),
|
|
|
|
"chef-solo": new(chefsoloprovisioner.Provisioner),
|
2021-04-21 14:19:34 -04:00
|
|
|
"converge": new(convergeprovisioner.Provisioner),
|
2021-04-20 13:44:31 -04:00
|
|
|
"puppet-masterless": new(puppetmasterlessprovisioner.Provisioner),
|
|
|
|
"puppet-server": new(puppetserverprovisioner.Provisioner),
|
2021-04-16 10:31:09 -04:00
|
|
|
}
|
2021-03-05 15:44:04 -05:00
|
|
|
|
2021-03-05 19:07:32 -05:00
|
|
|
// VendoredPostProcessors are post-processor components that were once bundled with the
|
|
|
|
// Packer core, but are now being imported from their counterpart plugin repos
|
2021-03-05 15:44:04 -05:00
|
|
|
var VendoredPostProcessors = map[string]packersdk.PostProcessor{
|
2021-04-19 17:05:40 -04:00
|
|
|
"alicloud-import": new(alicloudimportpostprocessor.PostProcessor),
|
2021-04-19 05:10:15 -04:00
|
|
|
"amazon-import": new(anazibimportpostprocessor.PostProcessor),
|
2021-04-22 05:45:27 -04:00
|
|
|
"digitalocean-import": new(digitaloceanimportpostprocessor.PostProcessor),
|
2021-04-19 05:10:15 -04:00
|
|
|
"docker-import": new(dockerimportpostprocessor.PostProcessor),
|
|
|
|
"docker-push": new(dockerpushpostprocessor.PostProcessor),
|
|
|
|
"docker-save": new(dockersavepostprocessor.PostProcessor),
|
|
|
|
"docker-tag": new(dockertagpostprocessor.PostProcessor),
|
|
|
|
"exoscale-import": new(exoscaleimportpostprocessor.PostProcessor),
|
|
|
|
"googlecompute-export": new(googlecomputeexportpostprocessor.PostProcessor),
|
|
|
|
"googlecompute-import": new(googlecomputeimportpostprocessor.PostProcessor),
|
2021-04-21 13:25:04 -04:00
|
|
|
"ucloud-import": new(ucloudimportpostprocessor.PostProcessor),
|
2021-04-21 16:31:28 -04:00
|
|
|
"vagrant": new(vagrantpostprocessor.PostProcessor),
|
|
|
|
"vagrant-cloud": new(vagrantcloudpostprocessor.PostProcessor),
|
2021-04-19 05:10:15 -04:00
|
|
|
"vsphere-template": new(vspheretemplatepostprocessor.PostProcessor),
|
|
|
|
"vsphere": new(vspherepostprocessor.PostProcessor),
|
2021-04-22 11:03:14 -04:00
|
|
|
"yandex-export": new(yandexexportpostprocessor.PostProcessor),
|
|
|
|
"yandex-import": new(yandeximportpostprocessor.PostProcessor),
|
2021-03-05 15:44:04 -05:00
|
|
|
}
|
|
|
|
|
2021-03-05 15:27:03 -05:00
|
|
|
// Upon init lets load up any plugins that were vendored manually into the default
|
|
|
|
// set of plugins.
|
2021-03-05 15:44:04 -05:00
|
|
|
func init() {
|
2021-03-25 08:37:48 -04:00
|
|
|
for k, v := range VendoredDatasources {
|
|
|
|
if _, ok := Datasources[k]; ok {
|
|
|
|
continue
|
|
|
|
}
|
|
|
|
Datasources[k] = v
|
|
|
|
}
|
|
|
|
|
2021-03-05 15:44:04 -05:00
|
|
|
for k, v := range VendoredBuilders {
|
|
|
|
if _, ok := Builders[k]; ok {
|
|
|
|
continue
|
|
|
|
}
|
|
|
|
Builders[k] = v
|
|
|
|
}
|
|
|
|
|
|
|
|
for k, v := range VendoredProvisioners {
|
|
|
|
if _, ok := Provisioners[k]; ok {
|
|
|
|
continue
|
|
|
|
}
|
|
|
|
Provisioners[k] = v
|
|
|
|
}
|
|
|
|
|
|
|
|
for k, v := range VendoredPostProcessors {
|
|
|
|
if _, ok := PostProcessors[k]; ok {
|
|
|
|
continue
|
|
|
|
}
|
|
|
|
PostProcessors[k] = v
|
|
|
|
}
|
|
|
|
}
|