v1

package
v4.0.0-alpha.5 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	// AlwaysTag it always run
	AlwaysTag = "always"
	// NeverTag it never run
	NeverTag = "never"
	// AllTag represent all tags
	AllTag = "all"
	// TaggedTag represent which has tags
	TaggedTag = "tagged"
)

the special tags

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"`
}

Base defined in project.

type Block

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

	BlockInfo
}

Block defined in project.

func (*Block) UnmarshalYAML

func (b *Block) UnmarshalYAML(unmarshal func(any) error) error

UnmarshalYAML yaml string to block.

type BlockBase

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

BlockBase defined in project.

type BlockInfo

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

BlockInfo defined in project.

type CollectionSearch

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

CollectionSearch defined in project.

type Conditional

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

Conditional defined in project.

type Delegatable

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

Delegatable defined in project.

type Handler

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

Handler defined in project.

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"`
}

LoopControl defined in project.

type Notifiable

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

Notifiable defined in project.

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"`
}

Play defined in project.

type PlayHost

type PlayHost struct {
	Hosts []string
}

PlayHost defined in project.

func (*PlayHost) UnmarshalYAML

func (p *PlayHost) UnmarshalYAML(unmarshal func(any) error) error

UnmarshalYAML yaml string to play

type PlaySerial

type PlaySerial struct {
	Data []any
}

PlaySerial defined in project.

func (*PlaySerial) UnmarshalYAML

func (s *PlaySerial) UnmarshalYAML(unmarshal func(any) error) error

UnmarshalYAML yaml string to serial.

type Playbook

type Playbook struct {
	Play []Play
}

Playbook defined in project.

func (*Playbook) Validate

func (p *Playbook) Validate() error

Validate playbook. delete empty ImportPlaybook which has convert to play.

type Role

type Role struct {
	RoleInfo
}

Role defined in project.

func (*Role) UnmarshalYAML

func (r *Role) UnmarshalYAML(unmarshal func(any) error) error

UnmarshalYAML yaml string to role.

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
}

RoleInfo defined in project.

type Taggable

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

Taggable if it should executor

func JoinTag

func JoinTag(child, parent Taggable) Taggable

JoinTag the child block should inherit tag for parent block

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"`

	// UnknownField store undefined filed
	UnknownField map[string]any `yaml:"-"`
}

Task defined in project.

type When

type When struct {
	Data []string
}

When defined in project.

func (*When) UnmarshalYAML

func (w *When) UnmarshalYAML(unmarshal func(any) error) error

UnmarshalYAML yaml string to when

Jump to

Keyboard shortcuts

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