ansible

package
v0.0.0-...-5c0e286 Latest Latest
Warning

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

Go to latest
Published: Mar 28, 2024 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenerateInventoryFile

func GenerateInventoryFile(servers []Server) string

param servers: list of servers to generate inventory file result: inventory file content

Types

type AnsibleCfg

type AnsibleCfg struct {
	SSHConnection map[string]any `json:"ssh_connection"`
	Defaults      map[string]any `json:"defaults"`
	Inventory     map[string]any `json:"inventory"`
}

type GoAnsiblePkg

type GoAnsiblePkg struct {
	LogChan chan string
	// contains filtered or unexported fields
}

func NewGoAnsiblePkg

func NewGoAnsiblePkg(c *conf.Bootstrap) *GoAnsiblePkg

func (*GoAnsiblePkg) ExecPlayBooks

func (a *GoAnsiblePkg) ExecPlayBooks(ctx context.Context) error

func (*GoAnsiblePkg) GenerateAnsibleCfg

func (a *GoAnsiblePkg) GenerateAnsibleCfg() (string, error)

func (*GoAnsiblePkg) GenerateServerInitPlaybook

func (a *GoAnsiblePkg) GenerateServerInitPlaybook() (string, error)

func (*GoAnsiblePkg) SetAnsiblePlaybookBinary

func (a *GoAnsiblePkg) SetAnsiblePlaybookBinary(ansiblePlaybookBinary string) *GoAnsiblePkg

func (*GoAnsiblePkg) SetCmdRunDir

func (a *GoAnsiblePkg) SetCmdRunDir(cmdRunDir string) *GoAnsiblePkg

func (*GoAnsiblePkg) SetEnv

func (a *GoAnsiblePkg) SetEnv(key, val string) *GoAnsiblePkg

func (*GoAnsiblePkg) SetEnvMap

func (a *GoAnsiblePkg) SetEnvMap(env map[string]string) *GoAnsiblePkg

func (*GoAnsiblePkg) SetInventoryFile

func (a *GoAnsiblePkg) SetInventoryFile(inventoryfile string) *GoAnsiblePkg

func (*GoAnsiblePkg) SetLogChan

func (a *GoAnsiblePkg) SetLogChan(logchan chan string) *GoAnsiblePkg

func (*GoAnsiblePkg) SetLogPrefix

func (a *GoAnsiblePkg) SetLogPrefix(logPrefix string) *GoAnsiblePkg

func (*GoAnsiblePkg) SetPlaybooks

func (a *GoAnsiblePkg) SetPlaybooks(playbooks []string) *GoAnsiblePkg

func (*GoAnsiblePkg) Write

func (a *GoAnsiblePkg) Write(p []byte) (n int, err error)

type Kubespray

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

func NewKubespray

func NewKubespray(c *conf.Resource) (*Kubespray, error)

func (*Kubespray) GetClusterPath

func (k *Kubespray) GetClusterPath() string

func (*Kubespray) GetDefaultClusterAddons

func (k *Kubespray) GetDefaultClusterAddons(ctx context.Context) (string, error)

func (*Kubespray) GetDefaultClusterAddonsConfig

func (k *Kubespray) GetDefaultClusterAddonsConfig(ctx context.Context) (string, error)

func (*Kubespray) GetDefaultClusterConfig

func (k *Kubespray) GetDefaultClusterConfig(ctx context.Context) (string, error)

func (*Kubespray) GetPackagePath

func (k *Kubespray) GetPackagePath() string

func (*Kubespray) GetRemoveNodePath

func (k *Kubespray) GetRemoveNodePath() string

func (*Kubespray) GetResetPath

func (k *Kubespray) GetResetPath() string

func (*Kubespray) GetScalePath

func (k *Kubespray) GetScalePath() string

func (*Kubespray) GetUpgradePath

func (k *Kubespray) GetUpgradePath() string

type Server

type Server struct {
	ID       string
	Ip       string
	Username string
	Role     string
}

type ServerInit

type ServerInit struct {
	Tasks []ServerInitTask `yaml:"tasks"`
}

type ServerInitTask

type ServerInitTask struct {
	Name     string `yaml:"name,omitempty"`
	Shell    string `yaml:"shell,omitempty"`
	Register string `yaml:"register,omitempty"`
	When     string `yaml:"when,omitempty"`
	IgnErr   string `yaml:"ignore_errors,omitempty"`
	Command  string `yaml:"command,omitempty"`
}

Jump to

Keyboard shortcuts

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