util

package
v0.0.0-...-b39efbf Latest Latest
Warning

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

Go to latest
Published: Mar 20, 2020 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SetupHostPlaybook    = "ansible/roles/setup_host/playbook.yml"
	ActivateHostPlaybook = "ansible/roles/setup_host/activate_playbook.yml"
)

Variables

This section is empty.

Functions

func ExecuteCmd

func ExecuteCmd(cmdName string, args []string) error

ExecuteCmd executes a shell command

func InitLog

func InitLog() *logrus.Logger

InitLog initializes the logger

func Log

func Log(ctx context.Context, logger *log.Logger) *log.Entry

func StructToMap

func StructToMap(in interface{}, f func(s string) string) map[string]string

StructToMap converts a struct to a map

Types

type AnsibleCommand

type AnsibleCommand struct {
	Playbook    string
	ExtraParams map[string]string
	User        string
	Host        string
	// contains filtered or unexported fields
}

func NewAnsibleCommand

func NewAnsibleCommand(playbook, user, host string, params map[string]string, logger *log.Logger) *AnsibleCommand

NewAnsibleCommand creates a new AnsibleCommand

func (*AnsibleCommand) ExecuteAnsible

func (ac *AnsibleCommand) ExecuteAnsible() error

ExecuteAnsible executes a given ansible playbook

Jump to

Keyboard shortcuts

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