Documentation ¶
Index ¶
Constants ¶
View Source
const ( Success = 0 Failure = 1 Changed = 2 )
Variables ¶
This section is empty.
Functions ¶
func ExecuteCommand ¶
Generic function that can be used to execute bash commands
Types ¶
type File ¶
type File struct { Path string `yaml:"Path"` Contents string `yaml:"Contents"` Owner string `yaml:"Owner"` Group string `yaml:"Group"` Perm fs.FileMode `yaml:"Perm"` }
func (File) Apply ¶
*
- This creates a file if the file does not exist with given permissions, contents, owner and group
func (File) Check ¶
*
- This checks if the file exists with given permissions, contents, owner and group
func (File) TriggerExec ¶
*
- This is not implemented since there does not seem to be usecase to trigger a file module
type Package ¶
func (Package) TriggerExec ¶
*
- This is not implemented since there does not seem to be usecase to trigger a package module
type Polis ¶
type Polis struct { ModuleType string `yaml:"ModuleType"` // Type of module: File, Service, Package Ensure bool `yaml:"Ensure"` // Ensure to be present or absent Triggers string `yaml:"Triggers"` // ID of the module to be triggered TriggerAction string `yaml:"TriggerAction"` // If this module is triggered, what should be the action to be taken Module Module `yaml:"Module"` // Module spec File, Service or Package }
Base polis struct which is the generic state
type Service ¶
type Service struct {
Name string `yaml:"Name"`
}
func (Service) Apply ¶
*
- This applies the service module by starting the service if the service is not up and running
func (Service) TriggerExec ¶
*
- This triggers the execution of the service module which essentially restarts the service
Click to show internal directories.
Click to hide internal directories.