diff --git a/configs/config-help.txt b/configs/config-help.txt deleted file mode 100644 index 5356ca9..0000000 --- a/configs/config-help.txt +++ /dev/null @@ -1,90 +0,0 @@ -================================================================================ -Retri Configuration File (config.yaml) Reference -================================================================================ - -This file is written in YAML format. The variables allowed in each section are -strictly defined. - --------------------------------------------------------------------------------- -Variable Precedence & Aggregation Rules --------------------------------------------------------------------------------- - -1. Single Variable Priority (<) - Evaluation Order: defaults < groups < device_types < hosts < env vars < CLI - (Values on the right override values on the left.) - - Environment variables: - - RETRI_SSH_PASSWORD: Overrides password from config (but not CLI -p) - - RETRI_SSH_SECRET: Overrides secret from config (but not CLI -s) - -2. Command Aggregation (+) - Execution Order: defaults + groups + device_types + hosts - (Commands are concatenated in this order and all are executed.) - --------------------------------------------------------------------------------- -Section Definitions & Available Variables --------------------------------------------------------------------------------- - -[defaults] Section - Sets global default values for the application. - - Available Variables: - user, password, secret : SSH/Sudo credentials (default fallback). - command, commands, command_file - : Commands to execute. - log_dir : Directory path for saving logs. - suffix : Suffix string appended to log filenames. - device_type : Default device type (e.g., "linux"). - parallel : Parallel execution count or "auto". - timestamp : Enable/disable timestamp in logs (true/false). [defaults only] - filename_format : Format string for log filenames. [defaults only] - timestamp_format : Date format string for filenames. [defaults only] - -[device_types] Section - Defines settings specific to device types. Keys are arbitrary identifiers - (e.g., "cisco_ios", "linux"). - - Special Behavior for 'linux': - If device_type is set to "linux", commands are executed via direct SSH execution - (non-interactive, no PTY) to ensure clean output without terminal control codes. - All other types default to interactive PTY sessions. - - Available Variables: - setup_commands : Commands executed immediately after login. [device_types only] - prompt_regex : Regex to detect command prompts. [device_types only] - exit_command : Command to exit the session (default: "exit"). - Use "quit" for Huawei devices. [device_types only] - user, password, secret : Credentials common to this device type. - command, commands, command_file - : Commands common to this device type. - log_dir : Log storage directory for this type. - -[groups] Section - Groups multiple hosts together for shared configuration. - - Available Variables: - name : Group name (Required). - hosts : List of hostnames belonging to the group. - (e.g., ["host1", "host2"]) - user, password, secret : Credentials common to the group. - command, commands, command_file - : Commands common to the group. - log_dir : Log storage directory for the group. - suffix : Suffix for log files in this group. - device_type : Device type applied to this group. - -[hosts] Section - Configures settings for individual hosts. - - Available Variables: - host : Hostname or IP (Required). - Supports range expansion (e.g., "switch-[01-10]"). - groups : List of group names this host belongs to. - (e.g., ["group1"]) - user, password, secret : Host-specific credentials. - command, commands, command_file - : Host-specific commands. - log_dir : Host-specific log directory. - device_type : Host-specific device type. - -================================================================================ diff --git a/main.go b/main.go index cb8cc93..f98d5bf 100644 --- a/main.go +++ b/main.go @@ -10,7 +10,7 @@ import ( //go:embed configs/config.yaml var defaultConfigContent []byte -//go:embed configs/config-help.txt +//go:embed docs/config-reference.yaml var helpContent string // Version is set via ldflags by GoReleaser (e.g., -X main.Version=1.2.3).