juju: github.com/juju/juju/environs/manual Index | Files | Directories

package manual

import "github.com/juju/juju/environs/manual"

Index

Package Files

addresses.go common.go provisioner.go

Constants

const ManualInstancePrefix = "manual:"

Variables

var (

    // ErrProvisioned is returned by ProvisionMachine if the target
    // machine has an existing machine agent.
    ErrProvisioned = errors.New("machine is already provisioned")
)

func HostAddress Uses

func HostAddress(hostname string) (network.ProviderAddress, error)

HostAddress returns an network.Address for the specified hostname, depending on whether it is an IP or a resolvable hostname. The address is given public scope.

func RecordMachineInState Uses

func RecordMachineInState(client ProvisioningClientAPI, machineParams params.AddMachineParams) (machineId string, err error)

RecordMachineInState records and saves into the state machine the provisioned machine

type ProvisionMachineArgs Uses

type ProvisionMachineArgs struct {
    // user and host of the ssh or winrm conn
    Host string
    User string

    // DataDir is the root directory for juju data.
    // If left blank, the default location "/var/lib/juju" will be used.
    DataDir string

    // Client provides the API needed to provision the machines.
    Client ProvisioningClientAPI

    // Stdin is required to respond to sudo prompts,
    // and must be a terminal (except in tests)
    Stdin io.Reader

    // Stdout is required to present sudo prompts to the user.
    Stdout io.Writer

    // Stderr is required to present machine provisioning progress to the user.
    Stderr io.Writer

    // AuthorizedKeys contains the concatenated authorized-keys to add to the
    // ubuntu user's ~/.ssh/authorized_keys.
    AuthorizedKeys string

    // WinRM contains keys and client interface api with the remote windows machine
    WinRM WinRMArgs

    *params.UpdateBehavior
}

ProvisionMachineArgs used for arguments for the Provisioner methods

type ProvisionMachineFunc Uses

type ProvisionMachineFunc func(ProvisionMachineArgs) (machineId string, err error)

ProvisionMachineFunc that every provisioner should have

type ProvisioningClientAPI Uses

type ProvisioningClientAPI interface {
    AddMachines([]params.AddMachineParams) ([]params.AddMachinesResult, error)
    ForceDestroyMachines(machines ...string) error
    ProvisioningScript(params.ProvisioningScriptParams) (script string, err error)
}

ProvisioningClientAPI defines the methods that are needed for the manual provisioning of machines. An interface is used here to decouple the API consumer from the actual API implementation type.

type WinRMArgs Uses

type WinRMArgs struct {
    // Keys that contains CACert, ClientCert, ClientKey
    Keys *winrm.X509

    // Client for interacting with windows machines
    Client WinrmClientAPI
}

WinRMArgs used for providing special context on how we interface with the windows machine

type WinrmClientAPI Uses

type WinrmClientAPI interface {
    Ping() error
    Run(cmd string, stdout, stderr io.Writer) error
    Password() string
}

WinrmClientAPI minimal interface for winrm windows machines interactions

Directories

PathSynopsis
sshprovisioner
winrmprovisioner

Package manual imports 8 packages (graph) and is imported by 131 packages. Updated 2019-10-19. Refresh now. Tools for package owners.