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 ¶
func NewGuestCommands ¶
func NewGuestCommands(osType string, sudo bool) (*GuestCommands, error)
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
Click to show internal directories.
Click to hide internal directories.