guestexec

package
v0.0.12 Latest Latest
Warning

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

Go to latest
Published: Feb 8, 2021 License: MPL-2.0 Imports: 8 Imported by: 0

Documentation

Overview

Package guestexec provides a shim for running common operating system commands on the guest/remote instance that is being provisioned. It helps provisioners which need to perform operating-system specific calls do so in a way that is simple and repeatable.

Note that to successfully use this package your provisioner must have knowledge of the guest type, which is not information that builders generally collect -- your provisioner will have to require guest information in its config.

Index

Constants

View Source
const DefaultOSType = UnixOSType
View Source
const UnixOSType = "unix"
View Source
const WindowsOSType = "windows"

Variables

This section is empty.

Functions

func GenerateElevatedRunner

func GenerateElevatedRunner(command string, p ElevatedProvisioner) (uploadedPath string, err error)

Types

type ElevatedProvisioner

type ElevatedProvisioner interface {
	Communicator() packersdk.Communicator
	ElevatedUser() string
	ElevatedPassword() string
}

type GuestCommands

type GuestCommands struct {
	GuestOSType string
	Sudo        bool
}

func NewGuestCommands

func NewGuestCommands(osType string, sudo bool) (*GuestCommands, error)

func (*GuestCommands) Chmod

func (g *GuestCommands) Chmod(path string, mode string) string

func (*GuestCommands) CreateDir

func (g *GuestCommands) CreateDir(path string) string

func (*GuestCommands) MovePath

func (g *GuestCommands) MovePath(srcPath string, dstPath string) string

func (*GuestCommands) RemoveDir

func (g *GuestCommands) RemoveDir(path string) string

func (*GuestCommands) StatPath

func (g *GuestCommands) StatPath(path string) string

Jump to

Keyboard shortcuts

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