rainbond: github.com/goodrain/rainbond/util/ansible Index | Files

package ansible

import "github.com/goodrain/rainbond/util/ansible"

Index

Package Files

ansible.go node.go

func RunNodeInstallCmd Uses

func RunNodeInstallCmd(option NodeInstallOption) (err error)

RunNodeInstallCmd install node

func WriteHostsFile Uses

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

WriteHostsFile write hosts file

type Host Uses

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 Uses

func (a *Host) String() string

String reutrn Host string

type HostConfig Uses

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

HostConfig ansible hosts config

func GetAnsibleHostConfig Uses

func GetAnsibleHostConfig(name string) *HostConfig

GetAnsibleHostConfig get config

func (*HostConfig) AddHost Uses

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

AddHost add host

func (*HostConfig) Content Uses

func (c *HostConfig) Content() string

Content return config file content

func (*HostConfig) ContentBuffer Uses

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

ContentBuffer content buffer

func (*HostConfig) WriteFile Uses

func (c *HostConfig) WriteFile() error

WriteFile write config file

type HostGroup Uses

type HostGroup struct {
    Name     string
    HostList HostsList
}

HostGroup ansible host group config

func (*HostGroup) AddHost Uses

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

AddHost add host

func (*HostGroup) String Uses

func (a *HostGroup) String() string

String return HostList string

type HostsList Uses

type HostsList []*Host

HostsList hosts list

func (HostsList) Len Uses

func (list HostsList) Len() int

func (HostsList) Less Uses

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

func (HostsList) Swap Uses

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

type NodeInstallOption Uses

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 node install option

Package ansible imports 15 packages (graph) and is imported by 2 packages. Updated 2019-08-23. Refresh now. Tools for package owners.