/morpheus-golang-task-plugin

Script Morpheus automation tasks in Go

Primary LanguageGroovy

Golang Morpheus Task Plugin

Write Morpheus automation tasks in Go.

Go must be installed on the appliance, and a /tmp/gocache folder created which is owned by morpheus-app user.

Only Standard Library modules are supported at this time.

Previous task output can be accessed in the plugin via a results map, the task code used as the key for example:

Todo

  • Figure out how to make the morpheus variable dictionary available to the Go code as well.
  • Test, digesting key/val and JSON output from previous task.
  • Helpers to use in teh Go script to present key/val and JSON output in the format required by Morpheus.

Example to print version of Go installed on appliance

package main

import (
  "fmt"
  "runtime"
)

func main(){
  fmt.Printf("Go version: %s\n", runtime.Version())
}

// outputs
// Go version: go1.18.2

image