Nautobot Plugin Nornir Credentials¶
nautobot_plugin_nornir.plugins.credentials
¶
Init file for credentials.
env_vars
¶
Credentials class for environment variables passwords.
CredentialsEnvVars
¶
Bases: MixinNautobotORMCredentials
Credentials Class designed to work with Nautobot ORM.
This class is the default class that will return the same login and password for all devices based on the values of the environment variables
Source code in nautobot_plugin_nornir/plugins/credentials/env_vars.py
__init__(params=None)
¶
Initialize Credentials Class designed to work with Nautobot ORM.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
params |
[dict]
|
Credentials Parameters |
None
|
Source code in nautobot_plugin_nornir/plugins/credentials/env_vars.py
nautobot_orm
¶
Credentials class designed to work with Nautobot ORM.
MixinNautobotORMCredentials
¶
Bases: NautobotORMCredentials
Abstract Credentials Class mixin, to provide base get_device_creds functionality.
Source code in nautobot_plugin_nornir/plugins/credentials/nautobot_orm.py
get_device_creds(device)
¶
Return the credentials for a given device.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
device |
Device
|
Nautobot device object |
required |
Return
username (string): password (string): secret (string):
Source code in nautobot_plugin_nornir/plugins/credentials/nautobot_orm.py
NautobotORMCredentials
¶
Abstract Credentials Class designed to work with Nautobot ORM.
Source code in nautobot_plugin_nornir/plugins/credentials/nautobot_orm.py
get_device_creds(device)
¶
Return the credentials for a given device.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
device |
Device
|
Nautobot device object |
required |
Return
username (string): password (string): secret (string):
Source code in nautobot_plugin_nornir/plugins/credentials/nautobot_orm.py
get_group_creds(group_name)
¶
Return the credentials for a given group.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
group_name |
string
|
Name of the group |
required |
Return
string: username string: password string: secret
Source code in nautobot_plugin_nornir/plugins/credentials/nautobot_orm.py
nautobot_secrets
¶
Credentials class designed to work with Nautobot Secrets Functionality.
Nautobot Secrets Feature:
secret-group
secret: username n
number of actual values.
secret: password n
number of actual values.
secret: secret n
number of actual values.
Caching Solution:
creds_cache = { "hashed key": "value" }
- "hashed key" is the rendred.parameter which is post template rendered secret key.
- "value" is the literal secrets value.
CredentialsNautobotSecrets
¶
Bases: MixinNautobotORMCredentials
Credentials Class designed to work with Nautobot Secrets Functionality.
Source code in nautobot_plugin_nornir/plugins/credentials/nautobot_secrets.py
49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 |
|
creds_cache
property
writable
¶
Getter for in memory creds cache. This is useds to temporarily cache secrets-group creds to avoid re-querying secrets providers over and over per device if the same secret-group was used.
Example
{"123435": 'supersecret'}
__init__()
¶
get_device_creds(device)
¶
Return the credentials for a given device.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
device |
Device
|
Nautobot device object |
required |
Return
username (string): password (string): secret (string):
Source code in nautobot_plugin_nornir/plugins/credentials/nautobot_secrets.py
settings_vars
¶
Credentials class for setting credentials.
CredentialsSettingsVars
¶
Bases: MixinNautobotORMCredentials
Credentials Class designed to work with Nautobot ORM that comes from settings.
This class will return the same login and password for all devices based on the values within your settings.
Source code in nautobot_plugin_nornir/plugins/credentials/settings_vars.py
__init__(params=None)
¶
Initialize Credentials Class designed to work with Nautobot ORM.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
params |
[dict]
|
Credentials Parameters |
None
|