Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problem : Undefined environment variables #54

Closed
josekampos opened this issue Apr 22, 2022 · 4 comments
Closed

Problem : Undefined environment variables #54

josekampos opened this issue Apr 22, 2022 · 4 comments

Comments

@josekampos
Copy link

josekampos commented Apr 22, 2022

Hi.

Nautobot is able to reach / authenticate my network devices using secrets + env variables.

For some strange reason when i try run a backup job, i get a message stating that the env variables are not available.


"SecretValueNotFoundError: Secret "cisco-user" (provider "EnvironmentVariableSecretsProvider"): Undefined environment variable "NAPALM_USERNAME"! "

here is my nautobot plugin config:

PLUGINS = ["nautobot_plugin_nornir", "nautobot_golden_config", "nautobot_device_lifecycle_mgmt"]

PLUGINS_CONFIG = {
    "nautobot_plugin_nornir": {
        "use_config_context": {"secrets": True, "connection_options": True},
        # Optionally set global connection options.
        "connection_options": {
            "napalm": {
                "extras": {
                    "optional_args": {"global_delay_factor": 1},
                },
            },
            "netmiko": {
                "extras": {
                    "global_delay_factor": 1,
                },
            },
        },
        "nornir_settings": {
            "credentials": "nautobot_plugin_nornir.plugins.credentials.nautobot_secrets.CredentialsNautobotSecrets",
            "runner": {
                "plugin": "threaded",
                "options": {
                    "num_workers": 20,
                },
            },
        },
    },
    "nautobot_golden_config": {
        "per_feature_bar_width": 0.15,
        "per_feature_width": 13,
        "per_feature_height": 4,
        "enable_backup": True,
        "enable_compliance": True,
        "enable_intended": True,
        "enable_sotagg": True,
        "sot_agg_transposer": None,
        "platform_slug_map": None,
        # "get_custom_compliance": "my.custom_compliance.func"
    },

}

Thanks in advance.

@itdependsnetworks
Copy link
Contributor

My guess is this section of the readme should answer your question:

The environment variable must be accessible on the web service. This often means simply exporting the environment variable will not suffice, but instead requiring users to update the nautobot.service file, however this will ultimately depend on your own setup. Environment variables are distinctively not nautobot configuration parameters (in naubot_config.py), if that does not makes sense, expect to see authentication issues.

[Service]
Environment="NAPALM_USERNAME=ntc"
Environment="NAPALM_PASSWORD=password123"
Environment="DEVICE_SECRET=password123”

@josekampos
Copy link
Author

I have exactly that configuration, so the issue must be from somewhere else...

@itdependsnetworks
Copy link
Contributor

I would suggest joining slack and asking there, this is meant for bugs, but fairly confident there is a configuration issue. SecretValueNotFoundError is based on a provider, but you haven't shown your provider information.

@josekampos
Copy link
Author

I agree, i'm closing this thread.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants