runner

package
v1.11.0 Latest Latest
Warning

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

Go to latest
Published: Aug 8, 2023 License: MIT Imports: 23 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Connector

type Connector interface {
	Connect(ctx context.Context, hostAddr, hostName, user string) (*executor.Remote, error)
}

Connector is an interface for connecting to a host, and returning remote executer.

type Playbook added in v1.6.0

type Playbook interface {
	AllTasks() []config.Task
	Task(name string) (*config.Task, error)
	TargetHosts(name string) ([]config.Destination, error)
	AllSecretValues() []string
	UpdateTasksTargets(vars map[string]string)
}

Playbook is an interface for getting task and target information from playbook.

type ProcResp added in v1.1.0

type ProcResp struct {
	Vars     map[string]string
	Commands int
	Hosts    int
}

ProcResp holds the information about processed commands and hosts.

type Process

type Process struct {
	Concurrency int
	Connector   Connector
	Playbook    Playbook
	Logs        executor.Logs
	Verbose     bool
	Dry         bool
	SSHShell    string

	Skip []string
	Only []string
}

Process is a struct that holds the information needed to run a process. It responsible for running a task on a target hosts.

func (*Process) Gen added in v1.6.0

func (p *Process) Gen(targets []string, tmplRdr io.Reader, respWr io.Writer) error

Gen generates the list target hosts for a given target, applying templates.

func (*Process) Run

func (p *Process) Run(ctx context.Context, task, target string) (s ProcResp, err error)

Run runs a task for a set of target hosts. Runs in parallel with limited concurrency, each host is processed in separate goroutine. Returns ProcResp with the information about processed commands and hosts plus vars from all thr commands.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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