Documentation
¶
Index ¶
- Constants
- func AnsibleGalaxy(requirements string)
- func AnsiblePlaybook(playbook string, inventory string, vars string, user string)
- func CloneRepos(terraformRepo string, ansibleRepo string, homedir string)
- func ColorPrint(colorText string, text string, option ...interface{})
- func Copy(src, dst string) (int64, error)
- func Exists(path string, homedir string) bool
- func ExistsFolderNoErr(path string, homedir string) bool
- func FormatRepo(repo string) string
- func Help()
- func HomeFix(path string, homedir string) string
- func IsURL(str string) bool
- func ReadFiles(searchDir string) ([]string, error)
- func TerraformApply(path string)
- func TerraformInit(path string)
- func Validate(path string, homedir string) string
- func ValidateConn(username string, privateKey string, homedir string, addr string, port string, ...)
Constants ¶
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 ¶
AnsiblePlaybook executes ansible-playbook using the playbook filepath passed Expects ansible binary to be present in PATH
func CloneRepos ¶
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 ¶
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 ExistsFolderNoErr ¶
ExistsFolderNoErr checks if path provided is a folder or not.
func FormatRepo ¶
FormatRepo returns folder name for a given URL
func ReadFiles ¶
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 ¶
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.