services

package module
v0.0.0-...-09c7c2e Latest Latest
Warning

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

Go to latest
Published: Aug 29, 2025 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ERROR = "[ERROR] "
	WARN  = "[WARNING] "
	INPUT = "[INPUT] "
	INFO  = "[INFO] "
)

ERROR const => red WARN const => yellow INPUT const => blue INFO const => green

Variables

This section is empty.

Functions

func AnsibleGalaxy

func AnsibleGalaxy(requirements string)

AnsibleGalaxy executes ansible-galaxy collection install using the requirements filepath passed Expects ansible binary to be present in PATH

func AnsiblePlaybook

func AnsiblePlaybook(playbook string, inventory string, vars string, user string)

AnsiblePlaybook executes ansible-playbook using the playbook filepath passed Expects ansible binary to be present in PATH

func CloneRepos

func CloneRepos(terraformRepo string, ansibleRepo string, homedir string)

CloneRepos clones repos if URLs provided are valid Also makes sure that the repo is not already cloned by checking the current dir for folder whose name matches the repo name

func ColorPrint

func ColorPrint(colorText string, text string, option ...interface{})

ColorPrint formats and prints the text according to the colorText provided. Other options are passed over to fmt.Printf to process and format correctly.

func Copy

func Copy(src, dst string) (int64, error)

Copy copies data from src to dst path

func Exists

func Exists(path string, homedir string) bool

Exists checks if path provided exists or not. Exits with an error if not.

func ExistsFolderNoErr

func ExistsFolderNoErr(path string, homedir string) bool

ExistsFolderNoErr checks if path provided is a folder or not.

func FormatRepo

func FormatRepo(repo string) string

FormatRepo returns folder name for a given URL

func Help

func Help()

Help prints out the help message for go-strategize

func HomeFix

func HomeFix(path string, homedir string) string

HomeFix resolves home-relative path to absolute path

func IsURL

func IsURL(str string) bool

IsURL checks if the provided URL is valid function from asaskevich/govalidator

func ReadFiles

func ReadFiles(searchDir string) ([]string, error)

ReadFiles walks through all filepaths in a given dir. Returns a list of filepaths if successful Exists with an error otherwise

func TerraformApply

func TerraformApply(path string)

TerraformApply executes terraform apply on the path using the -chdir option for terraform apply Expects terraform binary to be present in PATH

func TerraformInit

func TerraformInit(path string)

TerraformInit executes terraform init on the path using the -chdir option for terraform apply Expects terraform binary to be present in PATH

func Validate

func Validate(path string, homedir string) string

Validate checks if a relative path exists or not. Returns absolute path if its relative to home dir. Exits with status 1 if path not found

func ValidateConn

func ValidateConn(username string, privateKey string, homedir string, addr string, port string, strict bool)

ValidateConn validates all SSH connections. Does the following: > Connect to all VMs with known_hosts for callback > Tries to execute : 'echo 'Connected to' `hostname`' on VMs

Types

This section is empty.

Jump to

Keyboard shortcuts

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