Documentation ¶
Index ¶
- Constants
- func CatalogHandler(runnerService RunnerService) gin.HandlerFunc
- func CreateInventory(destination string, content *InventoryContent) error
- func ExecutionHandler(runnerService RunnerService) gin.HandlerFunc
- func HealthHandler(c *gin.Context)
- func NewCallbacksClient(callbacksUrl string) *callbacksClient
- func NewRunnerService(config *Config) (*runnerService, error)
- func ReadyHandler(runnerService RunnerService) gin.HandlerFunc
- type AnsibleRunner
- func (a *AnsibleRunner) RunPlaybook() error
- func (a *AnsibleRunner) SetCatalogDestination(destination string)
- func (a *AnsibleRunner) SetConfigFile(confFile string)
- func (a *AnsibleRunner) SetInventory(inventory string) error
- func (a *AnsibleRunner) SetPlaybook(playbook string) error
- func (a *AnsibleRunner) SetTrentoCallbacksUrl(callbacksUrl string)
- func (a *AnsibleRunner) SetTrentoExecutionID(executionID string)
- type App
- type CallbacksClient
- type Catalog
- type CatalogCheck
- type Config
- type CustomCommand
- type Dependencies
- type ExecutionEvent
- type ExecutionWorkerPool
- type Group
- type Host
- type InventoryContent
- type MockRunnerService
- func (_m *MockRunnerService) BuildCatalog() error
- func (_m *MockRunnerService) Execute(e *ExecutionEvent) error
- func (_m *MockRunnerService) GetCatalog() *Catalog
- func (_m *MockRunnerService) GetChannel() chan *ExecutionEvent
- func (_m *MockRunnerService) IsCatalogReady() bool
- func (_m *MockRunnerService) ScheduleExecution(e *ExecutionEvent) error
- type Node
- type RunnerService
Constants ¶
View Source
const ( CatalogDestination = "CATALOG_DESTINATION" TrentoCallbacksUrl = "TRENTO_CALLBACKS_URL" TrentoExecutionID = "TRENTO_EXECUTION_ID" AnsibleConfigFileEnv = "ANSIBLE_CONFIG" )
View Source
const ( AnsibleMain = "ansible/check.yml" AnsibleMeta = "ansible/meta.yml" AnsibleConfigFile = "ansible/ansible.cfg" AnsibleInventories = "ansible/inventories/%s/ansible_hosts" )
View Source
const (
CatalogDestinationFile = "ansible/catalog.json"
)
Variables ¶
This section is empty.
Functions ¶
func CatalogHandler ¶
func CatalogHandler(runnerService RunnerService) gin.HandlerFunc
func CreateInventory ¶
func CreateInventory(destination string, content *InventoryContent) error
func ExecutionHandler ¶
func ExecutionHandler(runnerService RunnerService) gin.HandlerFunc
func HealthHandler ¶
func NewCallbacksClient ¶
func NewCallbacksClient(callbacksUrl string) *callbacksClient
func NewRunnerService ¶
func ReadyHandler ¶
func ReadyHandler(runnerService RunnerService) gin.HandlerFunc
Types ¶
type AnsibleRunner ¶
func DefaultAnsibleRunner ¶
func DefaultAnsibleRunner() *AnsibleRunner
func NewAnsibleCheckRunner ¶
func NewAnsibleCheckRunner(config *Config, executionEvent *ExecutionEvent) (*AnsibleRunner, error)
func NewAnsibleMetaRunner ¶
func NewAnsibleMetaRunner(config *Config) (*AnsibleRunner, error)
func (*AnsibleRunner) RunPlaybook ¶
func (a *AnsibleRunner) RunPlaybook() error
func (*AnsibleRunner) SetCatalogDestination ¶
func (a *AnsibleRunner) SetCatalogDestination(destination string)
func (*AnsibleRunner) SetConfigFile ¶
func (a *AnsibleRunner) SetConfigFile(confFile string)
func (*AnsibleRunner) SetInventory ¶
func (a *AnsibleRunner) SetInventory(inventory string) error
func (*AnsibleRunner) SetPlaybook ¶
func (a *AnsibleRunner) SetPlaybook(playbook string) error
func (*AnsibleRunner) SetTrentoCallbacksUrl ¶
func (a *AnsibleRunner) SetTrentoCallbacksUrl(callbacksUrl string)
func (*AnsibleRunner) SetTrentoExecutionID ¶
func (a *AnsibleRunner) SetTrentoExecutionID(executionID string)
type App ¶
type App struct { Dependencies // contains filtered or unexported fields }
func NewAppWithDeps ¶
func NewAppWithDeps(config *Config, deps Dependencies) (*App, error)
type CallbacksClient ¶
type Catalog ¶
type Catalog []*CatalogCheck
type CatalogCheck ¶
type CatalogCheck struct { ID string `json:"id,omitempty" binding:"required"` Name string `json:"name,omitempty" binding:"required"` Group string `json:"group" binding:"required"` Provider string `json:"provider" binding:"required"` Description string `json:"description,omitempty"` Remediation string `json:"remediation,omitempty"` Implementation string `json:"implementation,omitempty"` Labels string `json:"labels,omitempty"` Premium bool `json:"premium,omitempty"` }
type Dependencies ¶
type Dependencies struct {
// contains filtered or unexported fields
}
func DefaultDependencies ¶
func DefaultDependencies(config *Config) Dependencies
type ExecutionEvent ¶
type ExecutionEvent struct { ExecutionID uuid.UUID `json:"execution_id" binding:"required"` ClusterID uuid.UUID `json:"cluster_id" binding:"required"` Provider string `json:"provider" binding:"required"` Checks []string `json:"checks" binding:"required"` Hosts []*Host `json:"hosts" binding:"required"` }
type ExecutionWorkerPool ¶
type ExecutionWorkerPool struct {
// contains filtered or unexported fields
}
func NewExecutionWorkerPool ¶
func NewExecutionWorkerPool(runnerService RunnerService) *ExecutionWorkerPool
func (*ExecutionWorkerPool) Run ¶
func (e *ExecutionWorkerPool) Run(ctx context.Context)
Run runs a pool of workers to process the execution requests
type InventoryContent ¶
func NewClusterInventoryContent ¶
func NewClusterInventoryContent(e *ExecutionEvent) (*InventoryContent, error)
type MockRunnerService ¶
MockRunnerService is an autogenerated mock type for the RunnerService type
func (*MockRunnerService) BuildCatalog ¶
func (_m *MockRunnerService) BuildCatalog() error
BuildCatalog provides a mock function with given fields:
func (*MockRunnerService) Execute ¶
func (_m *MockRunnerService) Execute(e *ExecutionEvent) error
Execute provides a mock function with given fields: e
func (*MockRunnerService) GetCatalog ¶
func (_m *MockRunnerService) GetCatalog() *Catalog
GetCatalog provides a mock function with given fields:
func (*MockRunnerService) GetChannel ¶
func (_m *MockRunnerService) GetChannel() chan *ExecutionEvent
GetChannel provides a mock function with given fields:
func (*MockRunnerService) IsCatalogReady ¶
func (_m *MockRunnerService) IsCatalogReady() bool
IsCatalogReady provides a mock function with given fields:
func (*MockRunnerService) ScheduleExecution ¶
func (_m *MockRunnerService) ScheduleExecution(e *ExecutionEvent) error
ScheduleExecution provides a mock function with given fields: e
type RunnerService ¶
type RunnerService interface { IsCatalogReady() bool BuildCatalog() error GetCatalog() *Catalog GetChannel() chan *ExecutionEvent ScheduleExecution(e *ExecutionEvent) error Execute(e *ExecutionEvent) error }
Source Files ¶
Click to show internal directories.
Click to hide internal directories.