Is there way to use a common credentials section in the devices.yaml file? #308
Unanswered
gglissendorf
asked this question in
Q&A
Replies: 1 comment
-
|
Searching through the code I haven't found a way to set a default for the username and password. Its only on a per device basis in the current version. You could try using a python file for the devices configuration. Here is an example and the docs # /etc/hyperglass/devices.py
def main():
default_username = "my_user"
default_password = "my_secret_password"
config = {
"devices": [
{
"address": "127.0.0.1",
"name": "home1",
"attrs": {"source4": "192.168.1.1", "source6":"2001:dead:beef::1"},
"credentials": {"username": default_username, "password": default_password},
"platform": "juniper"
},
{
"address": "127.0.0.2",
"name": "home2",
"attrs": {"source4": "192.168.1.2", "source6":"2001:dead:beef::2"},
"credentials": {"username": default_username, "password": default_password},
"platform": "juniper"
}
]
}
return config
#
# or
# Not sure if this one would work looking at the code. It executes the `main` export from the devices.py file, but it should get a reference back to the defaults.
#
default_username = "my_user"
default_password = "my_secret_password"
main = {
"devices": [
{
"address": "127.0.0.1",
"attrs": {"source4": "192.168.1.1", "source6":"2001:dead:beef::1"},
"credentials": {"username": default_username, "password": default_password},
"platform": "juniper"
},
{
"address": "127.0.0.2",
"attrs": {"source4": "192.168.1.2", "source6":"2001:dead:beef::2"},
"credentials": {"username": default_username, "password": default_password},
"platform": "juniper"
}
]
} |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Is there a way to set the devices.yaml to a shared username and password for all devices like the pervious version did with the .toml file
Beta Was this translation helpful? Give feedback.
All reactions