kobe

package
v0.0.0-...-96b04c8 Latest Latest
Warning

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

Go to latest
Published: Jun 12, 2023 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Inventory *api.Inventory
}

type Duration

type Duration struct {
	End   time.Time `json:"end"`
	Start time.Time `json:"start"`
}

type HostFailedInfo

type HostFailedInfo map[string]string

type Interface

type Interface interface {
	RunPlaybook(name, tag string) (string, error)
	Watch(writer io.Writer, taskId string) error
	GetResult(taskId string) (*api.Result, error)
	SetVar(key string, value string)
}

type Kobe

type Kobe struct {
	Project   string
	Inventory *api.Inventory
	// contains filtered or unexported fields
}

func NewAnsible

func NewAnsible(c *Config) *Kobe

func (*Kobe) GetResult

func (k *Kobe) GetResult(taskId string) (*api.Result, error)

func (*Kobe) RunAdhoc

func (k *Kobe) RunAdhoc(pattern, module, param string) (string, error)

func (*Kobe) RunPlaybook

func (k *Kobe) RunPlaybook(name, tag string) (string, error)

func (*Kobe) SetVar

func (k *Kobe) SetVar(key string, value string)

func (*Kobe) Watch

func (k *Kobe) Watch(writer io.Writer, taskId string) error

type Play

type Play struct {
	Name     string   `json:"name"`
	Duration Duration `json:"duration"`
	Tasks    []Task   `json:"tasks"`
}

type Result

type Result struct {
	Stats          map[string]Stat `json:"stats"`
	Plays          []Play          `json:"plays"`
	HostFailedInfo HostFailedInfo  `json:"-"`
}

func ParseResult

func ParseResult(content string) (result Result, err error)

func (*Result) GatherFailedInfo

func (r *Result) GatherFailedInfo()

type Stat

type Stat struct {
	Host        string `json:"host"`
	Change      int    `json:"change"`
	Failures    int    `json:"failures"`
	Ignored     int    `json:"ignored"`
	Ok          int    `json:"ok"`
	Rescued     int    `json:"rescued"`
	Skipped     int    `json:"skipped"`
	Unreachable int    `json:"unreachable"`
}

type Task

type Task struct {
	Duration Duration                          `json:"duration"`
	Name     string                            `json:"name"`
	Hosts    map[string]map[string]interface{} `json:"hosts"`
}

Jump to

Keyboard shortcuts

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