cirruslabs / packer-plugin-tart

Packer builder for Tart VMs
https://developer.hashicorp.com/packer/plugins/builders/tart
Mozilla Public License 2.0
65 stars 16 forks source link

Skip unneeded steps #126

Closed torarnv closed 6 months ago

torarnv commented 6 months ago

Without a communicator we can't provision, and if we don't have boot commands there's not any keys to send to the running VM, so running it is not needed.

This allows configuring builders that only create the VM, in preparation for later OS installation and provisioning:

source "tart-cli" "create-only" {
  cpu_count    = 4
  memory_gb    = 8
  disk_size_gb = 40
  from_ipsw    = var.ipsw_file
  vm_name      = "pre-install-vm"
  communicator = "none"
}
image

Also, there's no need to connect to VNC if we have no boot commands to type.

image
torarnv commented 6 months ago

Thanks!

Do you mind extracting b.config.CommunicatorConfig.Type != "none" into a variable like communicatorConfigured. I think it will cleaner to read the code. What do you think?

Absolutely, will push :)

torarnv commented 6 months ago

Pushed update :)

torarnv commented 6 months ago

Doh, missed the second one :D

torarnv commented 6 months ago

Like this?