ansible

package
v0.0.0-...-a3a5c94 Latest Latest
Warning

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

Go to latest
Published: Aug 21, 2021 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RunNodeInstallCmd

func RunNodeInstallCmd(option NodeInstallOption) (err error)

RunNodeInstallCmd - install node

func WriteHostsFile

func WriteHostsFile(filePath, installConfPath string, hosts []*client.HostNode) error

WriteHostsFile

Types

type Host

type Host struct {
	AnsibleHostIP net.IP
	//ssh port
	AnsibleHostPort          int
	HostID                   string
	Role                     client.HostRule
	CreateTime               time.Time
	AnsibleSSHPrivateKeyFile string
}

Host - ansible host config

func (*Host) String

func (a *Host) String() string

String - reutrn Host string

type HostConfig

type HostConfig struct {
	FileName  string
	GroupList map[string]*HostGroup
}

HostConfig - ansible hosts config

func GetAnsibleHostConfig

func GetAnsibleHostConfig(name string) *HostConfig

GetAnsibleHostConfig

func (*HostConfig) AddHost

func (c *HostConfig) AddHost(h *client.HostNode, installConfPath string)

AddHost

func (*HostConfig) Content

func (c *HostConfig) Content() string

Content - return config file content

func (*HostConfig) ContentBuffer

func (c *HostConfig) ContentBuffer() *bytes.Buffer

ContentBuffer

func (*HostConfig) WriteFile

func (c *HostConfig) WriteFile() error

WriteFile - write config file

type HostGroup

type HostGroup struct {
	Name     string
	HostList HostsList
}

HostGroup - ansible host group config

func (*HostGroup) AddHost

func (a *HostGroup) AddHost(h *Host)

AddHost

func (*HostGroup) String

func (a *HostGroup) String() string

String - return HostList string

type HostsList

type HostsList []*Host

HostsList

func (HostsList) Len

func (list HostsList) Len() int

func (HostsList) Less

func (list HostsList) Less(i, j int) bool

func (HostsList) Swap

func (list HostsList) Swap(i, j int)

type NodeInstallOption

type NodeInstallOption struct {
	HostRole   string
	HostName   string
	InternalIP string
	RootPass   string // ssh login password
	KeyPath    string // ssh login key path
	NodeID     string
	Stdin      io.Reader
	Stdout     io.Writer
	Stderr     io.Writer
	// contains filtered or unexported fields
}

NodeInstallOption

Jump to

Keyboard shortcuts

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