Documentation
¶
Index ¶
- Variables
- func GetConfig() *config.Config
- func GetDaemonClient() (*daemon.Client, error)
- func GetGraph(playbookFile string, tags, skipTags []string, baseConfig *config.Config, ...) (pkg.Graph, error)
- func NewLocalExecutorCmd(graph pkg.Graph) *cobra.Command
- func NewTemporalExecutorCmd(graph pkg.Graph) *cobra.Command
- func StartLocalExecutor(graph *pkg.Graph, inventoryFile string, cfg *config.Config, ...) error
- func StartLocalExecutorWithLimit(graph *pkg.Graph, inventoryFile string, cfg *config.Config, ...) error
- func StartTemporalExecutor(graph *pkg.Graph, inventoryFile string, spageAppConfig *config.Config, ...) error
- func StartTemporalExecutorWithLimit(graph *pkg.Graph, inventoryFile string, spageAppConfig *config.Config, ...) error
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // Version information - these can be set at build time using ldflags // Example: go build -ldflags "-X github.com/AlexanderGrooff/spage/cmd.Version=1.0.0 -X github.com/AlexanderGrooff/spage/cmd.GitCommit=$(git rev-parse HEAD) -X github.com/AlexanderGrooff/spage/cmd.BuildDate=$(date -u +%Y-%m-%dT%H:%M:%SZ)" Version = "dev" GitCommit = "unknown" BuildDate = "unknown" )
View Source
var LoadConfig = func(configFile string) error { configPaths := []string{} if configFile == "" { defaultConfig := "spage.yaml" if _, err := os.Stat(defaultConfig); err == nil { configPaths = append(configPaths, defaultConfig) } } else { configPaths = append(configPaths, configFile) } var err error cfg, err = config.Load(configPaths...) if err != nil { if configFile != "" || !os.IsNotExist(err) { return fmt.Errorf("failed to load configuration from %v: %w", configPaths, err) } cfg, err = config.Load() if err != nil { return fmt.Errorf("failed to load default configuration: %w", err) } } common.SetLogLevel(cfg.Logging.Level) if cfg.Logging.File != "" { if err := common.SetLogFile(cfg.Logging.File); err != nil { return fmt.Errorf("error setting log file: %w", err) } } if err := common.SetLogFormat(cfg.Logging); err != nil { return fmt.Errorf("error setting log format: %w", err) } if verbose { common.SetLogLevel("debug") } return nil }
LoadConfig loads the configuration and applies settings
View Source
var RootCmd = &cobra.Command{ Use: "spage", Short: "Simple Playbook AGEnt", Long: `A lightweight configuration management tool that compiles your playbooks into a Go program to run on a host.`, PersistentPreRunE: func(cmd *cobra.Command, args []string) error { if err := LoadConfig(configFile); err != nil { return err } if apiToken == "" && cfg != nil && cfg.ApiToken != "" { apiToken = cfg.ApiToken } return nil }, }
Functions ¶
func GetDaemonClient ¶ added in v1.0.0
func NewTemporalExecutorCmd ¶ added in v1.0.0
func StartLocalExecutor ¶ added in v1.0.0
func StartLocalExecutorWithLimit ¶ added in v1.0.0
func StartTemporalExecutor ¶ added in v1.0.0
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.