Documentation
¶
Index ¶
- func DefaultOutputName(stage string, f Format) string
- func Package(f Format, qcow2Path, dest string, opts *PackageOpts) error
- func RenderVagrantfile(opts VagrantOpts) (string, error)
- func WriteBoxVagrantfile(dest, boxFile, boxName string) error
- func WriteVagrantfile(dest string, opts VagrantOpts) error
- type Format
- type PackageOpts
- type VagrantOpts
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DefaultOutputName ¶
func RenderVagrantfile ¶
func RenderVagrantfile(opts VagrantOpts) (string, error)
RenderVagrantfile renders the vagrant-qemu Vagrantfile for opts.
func WriteBoxVagrantfile ¶
WriteBoxVagrantfile writes a minimal consumer Vagrantfile next to a .box package: "vagrant up" auto-adds the box from the local file and installs the provider plugin on first run. Credentials, ports, and provider config come from the Vagrantfile embedded in the box itself.
func WriteVagrantfile ¶
func WriteVagrantfile(dest string, opts VagrantOpts) error
WriteVagrantfile renders a vagrant-qemu Vagrantfile at dest that boots the built qcow2 box-less (no vagrant box needed): the user just runs "vagrant up" (the plugin auto-installs on first run).
Types ¶
type PackageOpts ¶
type PackageOpts struct {
VarsPath string
VMName string
MemoryMB int
CPUs int
// Vagrant parameterizes the Vagrantfile embedded in a Box package
// (ImageName is ignored — the box supplies the disk itself).
Vagrant *VagrantOpts
}
type VagrantOpts ¶
type VagrantOpts struct {
// ImageName is the qcow2 filename relative to the Vagrantfile.
// Required for the box-less Vagrantfile; ignored for Box packaging
// (the box supplies the disk itself).
ImageName string
// Box selects the variant embedded in a .box package: no image_path
// (vagrant copies the box's disk per machine).
Box bool
// Username and Password are the Windows account provisioned by the build.
Username string
Password string
// Hostname is passed as the SMBIOS serial; the image's boot task
// renames the guest to it (effective from the second boot).
Hostname string
// SSHPort is the host port vagrant-qemu forwards to the guest's OpenSSH.
SSHPort int
// RDPPort is the host port forwarded to the guest's RDP (:3389).
RDPPort int
MemoryGB int
CPUs int
}
VagrantOpts parameterizes the generated Vagrantfile. The zero value is filled with the same defaults the build VM uses.