v1

package
v4.0.0-alpha.0 Latest Latest
Warning

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

Go to latest
Published: Jul 1, 2024 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Base

type Base struct {
	Name string `yaml:"name,omitempty"`

	// connection/transport
	Connection string `yaml:"connection,omitempty"`
	Port       int    `yaml:"port,omitempty"`
	RemoteUser string `yaml:"remote_user,omitempty"`

	// variables
	Vars map[string]any `yaml:"vars,omitempty"`

	// flags and misc. settings
	Environment    []map[string]string `yaml:"environment,omitempty"`
	NoLog          bool                `yaml:"no_log,omitempty"`
	RunOnce        bool                `yaml:"run_once,omitempty"`
	IgnoreErrors   *bool               `yaml:"ignore_errors,omitempty"`
	CheckMode      bool                `yaml:"check_mode,omitempty"`
	Diff           bool                `yaml:"diff,omitempty"`
	AnyErrorsFatal bool                `yaml:"any_errors_fatal,omitempty"`
	Throttle       int                 `yaml:"throttle,omitempty"`
	Timeout        int                 `yaml:"timeout,omitempty"`

	// Debugger invoke a debugger on tasks
	Debugger string `yaml:"debugger,omitempty"`

	// privilege escalation
	Become       bool   `yaml:"become,omitempty"`
	BecomeMethod string `yaml:"become_method,omitempty"`
	BecomeUser   string `yaml:"become_user,omitempty"`
	BecomeFlags  string `yaml:"become_flags,omitempty"`
	BecomeExe    string `yaml:"become_exe,omitempty"`
}

type Block

type Block struct {
	BlockBase
	// If has Block, Task should be empty
	Task
	IncludeTasks string `yaml:"include_tasks,omitempty"`

	BlockInfo
}

func (*Block) UnmarshalYAML

func (b *Block) UnmarshalYAML(unmarshal func(interface{}) error) error

type BlockBase

type BlockBase struct {
	Base             `yaml:",inline"`
	Conditional      `yaml:",inline"`
	CollectionSearch `yaml:",inline"`
	Taggable         `yaml:",inline"`
	Notifiable       `yaml:",inline"`
	Delegatable      `yaml:",inline"`
}

type BlockInfo

type BlockInfo struct {
	Block  []Block `yaml:"block,omitempty"`
	Rescue []Block `yaml:"rescue,omitempty"`
	Always []Block `yaml:"always,omitempty"`
}

type CollectionSearch

type CollectionSearch struct {
	Collections []string `yaml:"collections,omitempty"`
}

type Conditional

type Conditional struct {
	When When `yaml:"when,omitempty"`
}

type Delegatable

type Delegatable struct {
	DelegateTo    string `yaml:"delegate_to,omitempty"`
	DelegateFacts bool   `yaml:"delegate_facts,omitempty"`
}

type Handler

type Handler struct {
	Listen []string `yaml:"listen,omitempty"`
}

type LoopControl

type LoopControl struct {
	LoopVar          string  `yaml:"loop_var,omitempty"`
	IndexVar         string  `yaml:"index_var,omitempty"`
	Label            string  `yaml:"label,omitempty"`
	Pause            float32 `yaml:"pause,omitempty"`
	Extended         bool    `yaml:"extended,omitempty"`
	ExtendedAllitems bool    `yaml:"extended_allitems,omitempty"`
}

type Notifiable

type Notifiable struct {
	Notify string `yaml:"notify,omitempty"`
}

type Play

type Play struct {
	ImportPlaybook string `yaml:"import_playbook,omitempty"`

	Base             `yaml:",inline"`
	Taggable         `yaml:",inline"`
	CollectionSearch `yaml:",inline"`

	PlayHost PlayHost `yaml:"hosts,omitempty"`

	// Facts
	GatherFacts bool `yaml:"gather_facts,omitempty"`

	// Variable Attribute
	VarsFiles []string `yaml:"vars_files,omitempty"`

	// Role Attributes
	Roles []Role `yaml:"roles,omitempty"`

	// Block (Task) Lists Attributes
	Handlers  []Block `yaml:"handlers,omitempty"`
	PreTasks  []Block `yaml:"pre_tasks,omitempty"`
	PostTasks []Block `yaml:"post_tasks,omitempty"`
	Tasks     []Block `yaml:"tasks,omitempty"`

	// Flag/Setting Attributes
	ForceHandlers     bool       `yaml:"force_handlers,omitempty"`
	MaxFailPercentage float32    `yaml:"percent,omitempty"`
	Serial            PlaySerial `yaml:"serial,omitempty"`
	Strategy          string     `yaml:"strategy,omitempty"`
	Order             string     `yaml:"order,omitempty"`
}

type PlayHost

type PlayHost struct {
	Hosts []string
}

func (*PlayHost) UnmarshalYAML

func (p *PlayHost) UnmarshalYAML(unmarshal func(interface{}) error) error

type PlaySerial

type PlaySerial struct {
	Data []any
}

func (*PlaySerial) UnmarshalYAML

func (s *PlaySerial) UnmarshalYAML(unmarshal func(interface{}) error) error

type Playbook

type Playbook struct {
	Play []Play
}

func (*Playbook) Validate

func (p *Playbook) Validate() error

type Role

type Role struct {
	RoleInfo
}

func (*Role) UnmarshalYAML

func (r *Role) UnmarshalYAML(unmarshal func(interface{}) error) error

type RoleInfo

type RoleInfo struct {
	Base             `yaml:",inline"`
	Conditional      `yaml:",inline"`
	Taggable         `yaml:",inline"`
	CollectionSearch `yaml:",inline"`

	// Role ref in playbook
	Role string `yaml:"role,omitempty"`

	Block []Block
}

type Taggable

type Taggable struct {
	Tags []string `yaml:"tags,omitempty"`
}

func (Taggable) IsEnabled

func (t Taggable) IsEnabled(onlyTags []string, skipTags []string) bool

IsEnabled check if the block should be executed

type Task

type Task struct {
	AsyncVal    int         `yaml:"async,omitempty"`
	ChangedWhen When        `yaml:"changed_when,omitempty"`
	Delay       int         `yaml:"delay,omitempty"`
	FailedWhen  When        `yaml:"failed_when,omitempty"`
	Loop        any         `yaml:"loop,omitempty"`
	LoopControl LoopControl `yaml:"loop_control,omitempty"`
	Poll        int         `yaml:"poll,omitempty"`
	Register    string      `yaml:"register,omitempty"`
	Retries     int         `yaml:"retries,omitempty"`
	Until       When        `yaml:"until,omitempty"`

	//
	UnknownFiled map[string]any `yaml:"-"`
}

type When

type When struct {
	Data []string
}

func (*When) UnmarshalYAML

func (w *When) UnmarshalYAML(unmarshal func(interface{}) error) error

Jump to

Keyboard shortcuts

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