runner

package
v0.0.0-...-7eda018 Latest Latest
Warning

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

Go to latest
Published: May 30, 2022 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TrentoWebApiHost     = "TRENTO_WEB_API_HOST"
	TrentoWebApiPort     = "TRENTO_WEB_API_PORT"
	AnsibleConfigFileEnv = "ANSIBLE_CONFIG"
)
View Source
const (
	AnsibleMain       = "ansible/check.yml"
	AnsibleMeta       = "ansible/meta.yml"
	AnsibleConfigFile = "ansible/ansible.cfg"
	AnsibleHostFile   = "ansible/ansible_hosts"
)
View Source
const (
	DefaultUser string = "root"
)

Variables

This section is empty.

Functions

func CreateInventory

func CreateInventory(destination string, content *InventoryContent) error

Types

type AnsibleRunner

type AnsibleRunner struct {
	Playbook  string
	Inventory string
	Envs      map[string]string
	Check     bool
}

func DefaultAnsibleRunner

func DefaultAnsibleRunner() *AnsibleRunner

func NewAnsibleCheckRunner

func NewAnsibleCheckRunner(config *Config) (*AnsibleRunner, error)

func NewAnsibleMetaRunner

func NewAnsibleMetaRunner(config *Config) (*AnsibleRunner, error)

func (*AnsibleRunner) RunPlaybook

func (a *AnsibleRunner) RunPlaybook() error

func (*AnsibleRunner) SetConfigFile

func (a *AnsibleRunner) SetConfigFile(confFile string)

func (*AnsibleRunner) SetInventory

func (a *AnsibleRunner) SetInventory(inventory string) error

func (*AnsibleRunner) SetPlaybook

func (a *AnsibleRunner) SetPlaybook(playbook string) error

func (*AnsibleRunner) SetTrentoApiData

func (a *AnsibleRunner) SetTrentoApiData(host string, port int)

type Config

type Config struct {
	ApiHost       string
	ApiPort       int
	Interval      time.Duration
	AnsibleFolder string
}

type CustomCommand

type CustomCommand func(name string, arg ...string) *exec.Cmd

type Group

type Group struct {
	Name  string
	Nodes []*Node
}

type InventoryContent

type InventoryContent struct {
	Groups []*Group
	Nodes  []*Node // this seems unused
}

func NewClusterInventoryContent

func NewClusterInventoryContent(trentoApi api.TrentoApiService) (*InventoryContent, error)

type Node

type Node struct {
	Name        string
	AnsibleHost string
	AnsibleUser string
	Variables   map[string]interface{}
}

type Runner

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

func NewRunner

func NewRunner(config *Config) (*Runner, error)

func (*Runner) Start

func (c *Runner) Start() error

func (*Runner) Stop

func (c *Runner) Stop()

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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