ansiblev2

package
v0.3.10-0-alpha2 Latest Latest
Warning

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

Go to latest
Published: Dec 15, 2022 License: Apache-2.0 Imports: 13 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Block

type Block struct {
	Name          string
	WithPlugin    string
	WithPluginVal interface{}
	When          string
	Register      string
	IgnoreErrors  bool
	Vars          map[string]interface{}

	Tasks []ITask
}

func NewBlock

func NewBlock(tasks ...ITask) *Block

func (*Block) MarshalYAML

func (b *Block) MarshalYAML() (interface{}, error)

type Host

type Host struct {
	Vars map[string]interface{}
}

func NewHost

func NewHost(args ...interface{}) *Host

type HostGroup

type HostGroup struct {
	Hosts    map[string]*Host
	Children map[string]*HostGroup
	Vars     map[string]interface{}
}

func NewHostGroup

func NewHostGroup(args ...interface{}) *HostGroup

func (*HostGroup) MarshalYAML

func (hg *HostGroup) MarshalYAML() (interface{}, error)

func (*HostGroup) SetChild

func (hg *HostGroup) SetChild(name string, child *HostGroup) *HostGroup

func (*HostGroup) SetHost

func (hg *HostGroup) SetHost(name string, host *Host) *HostGroup

type IPlaybookSession

type IPlaybookSession interface {
	GetPrivateKey() string
	GetPlaybook() string
	GetPlaybookPath() string
	GetInventory() string
	IsKeepTmpdir() bool
	GetConfigs() map[string]interface{}
	GetRequirements() string
	GetFiles() map[string][]byte
	GetOutputWriter() io.Writer
	GetRolePublic() bool
	GetTimeout() int
	CheckAndSetRunning() bool
	SetStopped()
	GetConfigYaml() string
}

type ITask

type ITask interface {
	MarshalYAML() (interface{}, error)
}

type IncludeRole

type IncludeRole struct {
	Name string
	Tags []string
	Vars map[string]interface{}
	When string
}

func (*IncludeRole) MarshalYAML

func (r *IncludeRole) MarshalYAML() (interface{}, error)

type Inventory

type Inventory struct {
	HostGroup
}

func NewInventory

func NewInventory(args ...interface{}) *Inventory

func (*Inventory) MarshalYAML

func (inv *Inventory) MarshalYAML() (interface{}, error)

func (*Inventory) String

func (inv *Inventory) String() string

type OfflineSession

type OfflineSession struct {
	PlaybookSessionBase
	// contains filtered or unexported fields
}

func NewOfflineSession

func NewOfflineSession() *OfflineSession

func (*OfflineSession) ConfigYaml

func (sess *OfflineSession) ConfigYaml(yaml string) *OfflineSession

func (*OfflineSession) Configs

func (sess *OfflineSession) Configs(configs map[string]interface{}) *OfflineSession

func (*OfflineSession) GetConfigYaml

func (sess *OfflineSession) GetConfigYaml() string

func (*OfflineSession) GetConfigs

func (sess *OfflineSession) GetConfigs() map[string]interface{}

func (*OfflineSession) GetPlaybookPath

func (sess *OfflineSession) GetPlaybookPath() string

func (*OfflineSession) Inventory

func (sess *OfflineSession) Inventory(s string) *OfflineSession

func (*OfflineSession) KeepTmpdir

func (sess *OfflineSession) KeepTmpdir(keep bool) *OfflineSession

func (*OfflineSession) OutputWriter

func (sess *OfflineSession) OutputWriter(w io.Writer) *OfflineSession

func (*OfflineSession) PlaybookPath

func (sess *OfflineSession) PlaybookPath(s string) *OfflineSession

func (*OfflineSession) PrivateKey

func (sess *OfflineSession) PrivateKey(s string) *OfflineSession

func (*OfflineSession) Run

func (sess *OfflineSession) Run(ctx context.Context) (err error)

type Play

type Play struct {
	Name         string
	RemoteUser   string
	Vars         map[string]interface{}
	IgnoreErrors bool

	Hosts string
	Tasks []ITask
}

func NewPlay

func NewPlay(tasks ...ITask) *Play

func (*Play) MarshalYAML

func (play *Play) MarshalYAML() (interface{}, error)

type Playbook

type Playbook struct {
	Plays []*Play
}

func NewPlaybook

func NewPlaybook(plays ...*Play) *Playbook

func (*Playbook) MarshalYAML

func (pb *Playbook) MarshalYAML() (interface{}, error)

func (*Playbook) String

func (pb *Playbook) String() string

type PlaybookSessionBase

type PlaybookSessionBase struct {
	// contains filtered or unexported fields
}

func NewPlaybookSessionBase

func NewPlaybookSessionBase() PlaybookSessionBase

func (*PlaybookSessionBase) CheckAndSetRunning

func (pb *PlaybookSessionBase) CheckAndSetRunning() bool

func (*PlaybookSessionBase) GetConfigYaml

func (pb *PlaybookSessionBase) GetConfigYaml() string

func (*PlaybookSessionBase) GetConfigs

func (pb *PlaybookSessionBase) GetConfigs() map[string]interface{}

func (*PlaybookSessionBase) GetFiles

func (pb *PlaybookSessionBase) GetFiles() map[string][]byte

func (*PlaybookSessionBase) GetInventory

func (pb *PlaybookSessionBase) GetInventory() string

func (*PlaybookSessionBase) GetOutputWriter

func (pb *PlaybookSessionBase) GetOutputWriter() io.Writer

func (*PlaybookSessionBase) GetPlaybook

func (pb *PlaybookSessionBase) GetPlaybook() string

func (*PlaybookSessionBase) GetPlaybookPath

func (pb *PlaybookSessionBase) GetPlaybookPath() string

func (*PlaybookSessionBase) GetPrivateKey

func (pb *PlaybookSessionBase) GetPrivateKey() string

func (*PlaybookSessionBase) GetRequirements

func (pb *PlaybookSessionBase) GetRequirements() string

func (*PlaybookSessionBase) GetRolePublic

func (pb *PlaybookSessionBase) GetRolePublic() bool

func (*PlaybookSessionBase) GetTimeout

func (pb *PlaybookSessionBase) GetTimeout() int

func (*PlaybookSessionBase) IsKeepTmpdir

func (pb *PlaybookSessionBase) IsKeepTmpdir() bool

func (*PlaybookSessionBase) SetStopped

func (pb *PlaybookSessionBase) SetStopped()

type Requirements

type Requirements struct {
	RoleSources []RoleSource
}

func NewRequirements

func NewRequirements(rss ...RoleSource) *Requirements

func (*Requirements) AddRoleSource

func (rm *Requirements) AddRoleSource(rss ...RoleSource)

func (*Requirements) MarshalYAML

func (rm *Requirements) MarshalYAML() (interface{}, error)

func (*Requirements) String

func (rm *Requirements) String() string

type RoleSource

type RoleSource struct {
	Name    string
	Src     string
	Version string
}

func (*RoleSource) MarshalYAML

func (rs *RoleSource) MarshalYAML() (interface{}, error)

type Session

type Session struct {
	PlaybookSessionBase
	// contains filtered or unexported fields
}

func NewSession

func NewSession() *Session

func (*Session) AddFile

func (sess *Session) AddFile(path string, data []byte) *Session

func (*Session) Files

func (sess *Session) Files(files map[string][]byte) *Session

func (*Session) GetFile

func (sess *Session) GetFile() map[string][]byte

func (*Session) GetPlaybook

func (sess *Session) GetPlaybook() string

func (*Session) GetRequirements

func (sess *Session) GetRequirements() string

func (*Session) Inventory

func (sess *Session) Inventory(s string) *Session

func (*Session) KeepTmpdir

func (sess *Session) KeepTmpdir(keep bool) *Session

func (*Session) OutputWriter

func (sess *Session) OutputWriter(w io.Writer) *Session

func (*Session) Playbook

func (sess *Session) Playbook(s string) *Session

func (*Session) PrivateKey

func (sess *Session) PrivateKey(s string) *Session

func (*Session) RemoveFile

func (sess *Session) RemoveFile(path string) []byte

func (*Session) Requirements

func (sess *Session) Requirements(s string) *Session

func (*Session) RolePublic

func (sess *Session) RolePublic(public bool) *Session

func (*Session) Run

func (sess *Session) Run(ctx context.Context) (err error)

func (*Session) Timeout

func (sess *Session) Timeout(timeout int) *Session

type ShellTask

type ShellTask struct {
	Name          string
	WithPlugin    string
	WithPluginVal interface{}
	When          string
	Register      string
	IgnoreErrors  bool
	Vars          map[string]interface{}

	Script     string
	ModuleArgs map[string]interface{}
}

func (*ShellTask) MarshalYAML

func (t *ShellTask) MarshalYAML() (interface{}, error)

type Task

type Task struct {
	Name          string
	WithPlugin    string
	WithPluginVal interface{}
	When          string
	Register      string
	IgnoreErrors  bool
	Vars          map[string]interface{}

	ModuleName string
	ModuleArgs map[string]interface{}
}

func (*Task) MarshalYAML

func (t *Task) MarshalYAML() (interface{}, error)

Jump to

Keyboard shortcuts

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