Semaphore/services/tasks/AnsibleJob.go
Denis Gukov b5a99eba7f
Runners (#1439)
* refactor(runners): extract jobs to separate entity
2023-08-27 18:02:51 +02:00

24 lines
556 B
Go

package tasks
import (
"github.com/ansible-semaphore/semaphore/lib"
"os"
)
type AnsibleJob interface {
RunGalaxy(args []string) error
RunPlaybook(args []string, environmentVars *[]string, cb func(*os.Process)) error
}
type LocalAnsibleJob struct {
playbook *lib.AnsiblePlaybook
}
func (j *LocalAnsibleJob) RunGalaxy(args []string) error {
return j.playbook.RunGalaxy(args)
}
func (j *LocalAnsibleJob) RunPlaybook(args []string, environmentVars *[]string, cb func(*os.Process)) error {
return j.playbook.RunPlaybook(args, environmentVars, cb)
}