add yaml include feature

This commit is contained in:
2025-07-06 12:27:49 +00:00
parent 9e0469e016
commit 8198b90e60
7 changed files with 453 additions and 111 deletions

View File

@ -6,6 +6,7 @@ SSH-based network device configuration backup tool with support for multiple dev
- **Multi-device backup**: Configure multiple routers in YAML
- **Device type templates**: Reusable command sets per device type
- **Configuration includes**: Split large configs with `!include` directives
- **Flexible authentication**: SSH agent, key files, or password
- **Selective execution**: Backup specific devices with `--host` flags
- **Professional CLI**: Standard flags, version info, and help
@ -24,24 +25,30 @@ make build
### Basic Usage
1. **Create configuration file** (`config.yaml`):
1. **Create configuration files**:
```yaml
types:
srlinux:
commands:
- show version
- show platform linecard
- info flat from running
**Main config** (`config.yaml`):
```yaml
!include device-types.yaml
devices:
asw100:
user: admin
type: srlinux
asw120:
user: admin
type: srlinux
```
devices:
asw100:
user: admin
type: srlinux
asw120:
user: admin
type: srlinux
```
**Device types** (`device-types.yaml`):
```yaml
types:
srlinux:
commands:
- show version
- show platform linecard
- info flat from running
```
2. **Run backup**: