model

package
v0.1.9 Latest Latest
Warning

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

Go to latest
Published: Dec 18, 2024 License: GPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Asset

type Asset struct {
	Name  string `json:"name,omitempty"`
	Files []File `json:"files,omitempty"`
}

type File

type File struct {
	Path string      `json:"path,omitempty"`
	Data []byte      `json:"data,omitempty"`
	Mode fs.FileMode `json:"mode,omitempty"`
}

type Inventory

type Inventory []Target

type Job

type Job struct {
	Vars     Vars     `json:"vars,omitempty"`
	Playbook Playbook `json:"playbook,omitempty"`
}

func (*Job) String

func (j *Job) String() string

func (*Job) Tasks

func (j *Job) Tasks() []Task

type Play

type Play struct {
	Name      string         `json:"name,omitempty"`
	AssetPath string         `json:"assets,omitempty"`
	Hosts     []TargetName   `json:"hosts,omitempty"`
	Vars      map[string]any `json:"vars,omitempty"`
	Tasks     []Task         `json:"tasks,omitempty"`
	Handlers  []Task         `json:"handlers,omitempty"`
	PreRun    []string       `json:"prerun,omitempty"`
}

type Playbook

type Playbook []Play

type ReportMsg

type ReportMsg struct {
	TaskIdx    int
	TaskTotal  int
	TaskResult TaskResult
}

type Target

type Target struct {
	User string
	Host string
	Port int
	Tag  string
}

type TargetName

type TargetName string

type Task

type Task struct {
	Runner string   `json:"runner,omitempty"`
	Name   string   `json:"name,omitempty"`
	Args   TaskArgs `json:"args,omitempty"`
	Notify []string `json:"notify,omitempty"`
	Loop   []any    `json:"loop,omitempty"`
	Vars   TaskVars `json:"vars,omitempty"`
	Tags   []string `json:"tags,omitempty"`
	Unless string   `json:"unless,omitempty"`
}

func (Task) Clone

func (t Task) Clone() Task

type TaskArgs

type TaskArgs map[string]any

func (TaskArgs) String

func (ta TaskArgs) String(s string) string

func (TaskArgs) StringSlice

func (ta TaskArgs) StringSlice(s string) []string

func (TaskArgs) ToString

func (ta TaskArgs) ToString() string

type TaskResult

type TaskResult struct {
	Host     TargetName      `json:"target,omitempty"`
	Changed  bool            `json:"changed,omitempty"`
	Output   string          `json:"output,omitempty"`
	Status   int             `json:"status_code,omitempty"`
	Duration time.Duration   `json:"duration,omitempty"`
	Task     *Task           `json:"task,omitempty"`
	Notify   map[string]bool `json:"notify,omitempty"`
}

func (TaskResult) String

func (tr TaskResult) String() string

type TaskVars

type TaskVars map[string]any

type Vars

type Vars map[string]any

Jump to

Keyboard shortcuts

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