vagrant

package
v1.3.5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 28, 2019 License: MPL-2.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

View Source
const BuilderId = "vagrant"

This is the common builder ID to all of these artifacts.

View Source
const VAGRANT_MIN_VERSION = ">= 2.0.2"

Variables

View Source
var DEFAULT_TEMPLATE = `` /* 250-byte string literal not displayed */

Functions

func CommHost

func CommHost() func(multistep.StateBag) (string, error)

func NewArtifact

func NewArtifact(dir string) (packer.Artifact, error)

NewArtifact returns a vagrant artifact containing the .box file

func SSHPort

func SSHPort() func(multistep.StateBag) (int, error)

Types

type Builder

type Builder struct {
	// contains filtered or unexported fields
}

Builder implements packer.Builder and builds the actual VirtualBox images.

func (*Builder) Cancel

func (b *Builder) Cancel()

Cancel.

func (*Builder) Prepare

func (b *Builder) Prepare(raws ...interface{}) ([]string, error)

Prepare processes the build configuration parameters.

func (*Builder) Run

func (b *Builder) Run(ui packer.Ui, hook packer.Hook, cache packer.Cache) (packer.Artifact, error)

Run executes a Packer build and returns a packer.Artifact representing a VirtualBox appliance.

type Config

type Config struct {
	common.PackerConfig    `mapstructure:",squash"`
	common.HTTPConfig      `mapstructure:",squash"`
	common.ISOConfig       `mapstructure:",squash"`
	common.FloppyConfig    `mapstructure:",squash"`
	bootcommand.BootConfig `mapstructure:",squash"`
	SSHConfig              `mapstructure:",squash"`

	// This is the name of the new virtual machine.
	// By default this is "packer-BUILDNAME", where "BUILDNAME" is the name of the build.
	OutputDir    string `mapstructure:"output_dir"`
	SourceBox    string `mapstructure:"source_path"`
	GlobalID     string `mapstructure:"global_id"`
	Checksum     string `mapstructure:"checksum"`
	ChecksumType string `mapstructure:"checksum_type"`
	BoxName      string `mapstructure:"box_name"`

	Provider string `mapstructure:"provider"`

	Communicator string `mapstructure:"communicator"`

	// What vagrantfile to use
	VagrantfileTpl string `mapstructure:"vagrantfile_template"`

	// Whether to Halt, Suspend, or Destroy the box
	TeardownMethod string `mapstructure:"teardown_method"`

	// Options for the "vagrant init" command
	BoxVersion   string `mapstructure:"box_version"`
	Template     string `mapstructure:"template"`
	SyncedFolder string `mapstructure:"synced_folder"`

	// Options for the "vagrant box add" command
	SkipAdd     bool   `mapstructure:"skip_add"`
	AddCACert   string `mapstructure:"add_cacert"`
	AddCAPath   string `mapstructure:"add_capath"`
	AddCert     string `mapstructure:"add_cert"`
	AddClean    bool   `mapstructure:"add_clean"`
	AddForce    bool   `mapstructure:"add_force"`
	AddInsecure bool   `mapstructure:"add_insecure"`

	// Don't package the Vagrant box after build.
	SkipPackage       bool     `mapstructure:"skip_package"`
	OutputVagrantfile string   `mapstructure:"output_vagrantfile"`
	PackageInclude    []string `mapstructure:"package_include"`
	// contains filtered or unexported fields
}

type SSHConfig

type SSHConfig struct {
	Comm communicator.Config `mapstructure:",squash"`
}

type StepAddBox

type StepAddBox struct {
	BoxVersion   string
	CACert       string
	CAPath       string
	DownloadCert string
	Clean        bool
	Force        bool
	Insecure     bool
	Provider     string
	SourceBox    string
	BoxName      string
	GlobalID     string
	SkipAdd      bool
}

func (*StepAddBox) Cleanup

func (s *StepAddBox) Cleanup(state multistep.StateBag)

func (*StepAddBox) Run

type StepCreateVagrantfile

type StepCreateVagrantfile struct {
	Template     string
	SourceBox    string
	OutputDir    string
	SyncedFolder string
	GlobalID     string
}

func (*StepCreateVagrantfile) Cleanup

func (s *StepCreateVagrantfile) Cleanup(state multistep.StateBag)

func (*StepCreateVagrantfile) Run

type StepPackage

type StepPackage struct {
	SkipPackage bool
	Include     []string
	Vagrantfile string
	GlobalID    string
}

func (*StepPackage) Cleanup

func (s *StepPackage) Cleanup(state multistep.StateBag)

func (*StepPackage) Run

type StepSSHConfig

type StepSSHConfig struct {
	GlobalID string
}

func (*StepSSHConfig) Cleanup

func (s *StepSSHConfig) Cleanup(state multistep.StateBag)

func (*StepSSHConfig) Run

type StepUp

type StepUp struct {
	TeardownMethod string
	Provider       string
	GlobalID       string
}

func (*StepUp) Cleanup

func (s *StepUp) Cleanup(state multistep.StateBag)

func (*StepUp) Run

type VagrantDriver

type VagrantDriver interface {
	// Calls "vagrant init"
	Init([]string) error

	// Calls "vagrant add"
	Add([]string) error

	// Calls "vagrant up"
	Up([]string) (string, string, error)

	// Calls "vagrant halt"
	Halt(string) error

	// Calls "vagrant suspend"
	Suspend(string) error

	SSHConfig(string) (*VagrantSSHConfig, error)

	// Calls "vagrant destroy"
	Destroy(string) error

	// Calls "vagrant package"[
	Package([]string) error

	// Verify checks to make sure that this driver should function
	// properly. If there is any indication the driver can't function,
	// this will return an error.
	Verify() error

	// Version reads the version of VirtualBox that is installed.
	Version() (string, error)
}

func NewDriver

func NewDriver(outputDir string) (VagrantDriver, error)

type VagrantSSHConfig

type VagrantSSHConfig struct {
	Hostname               string
	User                   string
	Port                   string
	UserKnownHostsFile     string
	StrictHostKeyChecking  bool
	PasswordAuthentication bool
	IdentityFile           string
	IdentitiesOnly         bool
	LogLevel               string
}

type Vagrant_2_2_Driver

type Vagrant_2_2_Driver struct {
	VagrantCWD string
	// contains filtered or unexported fields
}

func (*Vagrant_2_2_Driver) Add

func (d *Vagrant_2_2_Driver) Add(args []string) error

Calls "vagrant add"

func (*Vagrant_2_2_Driver) Destroy

func (d *Vagrant_2_2_Driver) Destroy(id string) error

Calls "vagrant destroy"

func (*Vagrant_2_2_Driver) Halt

func (d *Vagrant_2_2_Driver) Halt(id string) error

Calls "vagrant halt"

func (*Vagrant_2_2_Driver) Init

func (d *Vagrant_2_2_Driver) Init(args []string) error

Calls "vagrant init"

func (*Vagrant_2_2_Driver) Package

func (d *Vagrant_2_2_Driver) Package(args []string) error

Calls "vagrant package"

func (*Vagrant_2_2_Driver) SSHConfig

func (d *Vagrant_2_2_Driver) SSHConfig(id string) (*VagrantSSHConfig, error)

func (*Vagrant_2_2_Driver) Suspend

func (d *Vagrant_2_2_Driver) Suspend(id string) error

Calls "vagrant suspend"

func (*Vagrant_2_2_Driver) Up

func (d *Vagrant_2_2_Driver) Up(args []string) (string, string, error)

Calls "vagrant up"

func (*Vagrant_2_2_Driver) Verify

func (d *Vagrant_2_2_Driver) Verify() error

Verify makes sure that Vagrant exists at the given path

func (*Vagrant_2_2_Driver) Version

func (d *Vagrant_2_2_Driver) Version() (string, error)

Version reads the version of VirtualBox that is installed.

type VagrantfileOptions

type VagrantfileOptions struct {
	SyncedFolder string
	BoxName      string
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL