parlaytypes

package module
v0.0.0-...-58306fc Latest Latest
Warning

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

Go to latest
Published: May 20, 2020 License: Apache-2.0 Imports: 3 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Action

type Action struct {
	Name       string `json:"name"`
	ActionType string `json:"type"`
	Timeout    int    `json:"timeout"`

	// File based operations
	Source      string `json:"source,omitempty"`
	Destination string `json:"destination,omitempty"`
	FileMove    bool   `json:"fileMove,omitempty"`

	// Package manager operations
	PkgManager   string `json:"packageManager,omitempty"`
	PkgOperation string `json:"packageOperation,omitempty"`
	Packages     string `json:"packages,omitempty"`

	// Command operations
	Command          string   `json:"command,omitempty"`
	Commands         []string `json:"commands,omitempty"`
	CommandLocal     bool     `json:"commandLocal,omitempty"`
	CommandSaveFile  string   `json:"commandSaveFile,omitempty"`
	CommandSaveAsKey string   `json:"commandSaveAsKey,omitempty"`
	CommandSudo      string   `json:"commandSudo,omitempty"`

	// Piping commands, read in a file and send over stdin, or capture stdout from a local command
	CommandPipeFile string `json:"commandPipeFile,omitempty"`
	CommandPipeCmd  string `json:"commandPipeCmd,omitempty"`

	// Ignore any failures
	IgnoreFailure bool `json:"ignoreFail,omitempty"`

	// Key operations
	KeyFile string `json:"keyFile,omitempty"`
	KeyName string `json:"keyName,omitempty"`

	//Plugin Spec
	Plugin json.RawMessage `json:"plugin,omitempty"`
}

Action defines what the instructions that will be executed

type Deployment

type Deployment struct {
	// Name of the deployment that is taking place i.e. (Install MySQL)
	Name string `json:"name"`
	// An array/list of hosts that these actions should be performed upon
	Hosts []string `json:"hosts"`

	// Parallel allow multiple actions across multiple hosts in parallel
	Parallel         bool `json:"parallel"`
	ParallelSessions int  `json:"parallelSessions"`

	// The actions that should be performed
	Actions []Action `json:"actions"`
}

Deployment defines the hosts and the action(s) that should be performed on them

func (*Deployment) FindActions

func (d *Deployment) FindActions(actions []string) ([]Action, error)

FindActions - will iterate through the deployment actions and compare to the array of actions to return

func (*Deployment) FindHosts

func (d *Deployment) FindHosts(hosts []string) (*Deployment, error)

FindHosts - will iterate through the deployment hosts and compare to the array of hosts to return

type TreasureMap

type TreasureMap struct {
	// An array/list of deployments that will take places as part of this "map"
	Deployments []Deployment `json:"deployments"`
}

TreasureMap - X Marks the spot The treasure maps define the automation that will take place on the hosts defined

func (*TreasureMap) FindDeployment

func (m *TreasureMap) FindDeployment(deployment, action, host, logFile string, resume bool) (*TreasureMap, error)

FindDeployment - takes a number of flags and builds a new map to be processed

func (*TreasureMap) FindDeployments

func (m *TreasureMap) FindDeployments(deployment []string) (*TreasureMap, error)

FindDeployments - This will iterate through a deployment map and build a new deployment map from found deployments

Jump to

Keyboard shortcuts

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