-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathconfig.example.hcl
50 lines (44 loc) · 1.22 KB
/
config.example.hcl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
include "config.device_classes.hcl" {}
preferences {
// The destination directory for all configurations
backup_dir = "./config-backups/"
// The IP address devices will use to upload their configs
host_ip = "192.168.100.10"
}
device_class "sample_device_class" {
backup_target "config_target" {
// The macro to trigger the config upload on the device
macro = <<-MACRO
expect(">")
sendLine("enable")
expect("Password: ")
sendLine(getAuthAttr("enable_password"))
expect("# ")
sendLine("configure terminal")
expect("# ")
sendLine("copy startup-config tftp")
expect("?")
sendLine(ctx.TFTPHost)
expect("?")
sendLine(ctx.TFTPFilename)
expect("# ")
MACRO
}
}
auth_provider "static" "basic_auth" {
auth "secretA" {
username = "jdoe"
password = "supersecret"
}
auth "secretB" {
username = "jdoe"
password = "supersecret"
attributes {
enable_password = "supersecret2"
}
}
}
device "sample_device_class" "sample_device" {
address = "192.168.100.1:22"
auth = "basic_auth:secretA"
}