GithubHelp home page GithubHelp logo

nautobot / nautobot-app-golden-config Goto Github PK

View Code? Open in Web Editor NEW
96.0 96.0 56.0 7.34 MB

Golden Configuration App for Nautobot.

Home Page: https://docs.nautobot.com/projects/golden-config/en/latest/

License: Other

Dockerfile 0.67% Python 88.30% HTML 8.71% JavaScript 2.19% Jinja 0.14%
nautobot nautobot-plugin

nautobot-app-golden-config's Introduction

Nautobot

Nautobot

Nautobot is a Network Source of Truth and Network Automation Platform built as a web application atop the Django Python framework with a PostgreSQL or MySQL database.

Key Use Cases

1. Flexible Source of Truth for Networking - Nautobot core data models are used to define the intended state of network infrastructure enabling it as a Source of Truth. While a baseline set of models are provided (such as IP networks and addresses, devices and racks, circuits and cable, etc.) it is Nautobot's goal to offer maximum data model flexibility. This is enabled through features such as user-defined relationships, custom fields on any model, and data validation that permits users to codify everything from naming standards to having automated tests run before data can be populated into Nautobot.

2. Extensible Data Platform for Automation - Nautobot has a rich feature set to seamlessly integrate with network automation solutions. Nautobot offers GraphQL and native Git integration along with REST APIs and webhooks. Git integration dynamically loads YAML data files as Nautobot config contexts. Nautobot also has an evolving plugin system that enables users to create custom models, APIs, and UI elements. The plugin system is also used to unify and aggregate disparate data sources creating a Single Source of Truth to streamline data management for network automation.

3. Platform for Network Automation Apps - The Nautobot plugin system enables users to create Network Automation Apps. Apps can be as lightweight or robust as needed based on user needs. Using Nautobot for creating custom applications saves up to 70% development time by re-using features such as authentication, permissions, webhooks, GraphQL, change logging, etc. all while having access to the data already stored in Nautobot. Some production ready applications include:

The complete documentation for Nautobot can be found at Read the Docs.

Questions? Comments? Start by perusing our GitHub discussions for the topic you have in mind, or join the #nautobot channel on Network to Code's Slack community!

Build Status

Branch Status
main Build Status
develop Build Status
next Build Status

Screenshots

Gif of main page


Gif of config contexts


Gif of prefix hierarchy


Gif of GraphQL


Gif of Modes

Installation

Please see the documentation for instructions on installing Nautobot.

Application Stack

Below is a simplified overview of the Nautobot application stack for reference:

Application stack diagram

Plugins and Extensibility

Nautobot offers the ability to customize your setup to better align with your direct business needs. It does so through the use of various plugins that have been developed for network automation, and are designed to be used in environments where needed.

There are many plugins available within the Nautobot Apps ecosystem. The below screenshots are an example of some popular ones that are currently available.

Plugin Screenshots

Golden Config Plugin

Gif of golden config

ChatOps Plugin

Gif of chatops

Device Lifecycle Management Plugin

Gif of DLM

Providing Feedback

The best platform for general feedback, assistance, and other discussion is our GitHub discussions. To report a bug or request a specific feature, please open a GitHub issue using the appropriate template.

If you are interested in contributing to the development of Nautobot, please read our contributing guide prior to beginning any work.

Related projects

Please check out the GitHub nautobot topic for a list of relevant community projects.

Notices

Nautobot was initially developed as a fork of NetBox (v2.10.4). NetBox was originally developed by Jeremy Stretch at DigitalOcean and the NetBox Community.

nautobot-app-golden-config's People

Contributors

alhogan avatar briddo avatar bryanculver avatar chadell avatar cmsirbu avatar dependabot[bot] avatar fragmentedpacket avatar gertzakis avatar hussainongithub avatar itdependsnetworks avatar jdrew82 avatar jeffkala avatar jmcgill298 avatar joewesch avatar jvanderaa avatar kacem-expereo avatar kircheneer avatar mattmiller87 avatar mitchell-foxworth avatar mzbroch avatar nautobot-bot avatar nkallergis avatar nniehoff avatar pato23arg avatar pke11y avatar progala avatar scetron avatar snaselj avatar ubajze avatar whitej6 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

nautobot-app-golden-config's Issues

Add models to GraphQL

The configuration compliance models should be exposed to the GraphQL schema within Nautobot.

Expose all models via API

Expose APIs for

  • ComplianceFeature
  • ComplianceRule
  • ConfigCompliance
  • GoldenConfiguration
  • GoldenConfigSettings

Actions icons/links should have titles for mouseover hints

Environment

  • Python version:
  • Nautobot version: 1.0.2
  • nautobot-golden-config version: whatever version is on demo.nautobot.com at present

Steps to Reproduce

  1. Navigate to https://demo.nautobot.com/plugins/golden-config/golden/
  2. Table presents a set of "action" icons that are not obvious in meaning:
    image
  3. Mouse over each icon hoping for a tooltip indicating what each icon means or does

Expected Behavior

Tooltip, as might be derived from link's title= attribute, such as the following mockup:

image

Observed Behavior

No such tooltip - icon meaning is non-obvious.

Device Level Management

Environment

  • Python version: 3.7
  • Nautobot version: 1.0
  • nautobot-golden-config version: 0.9

Proposed Functionality

The ability to manage whether or not a device is included in the various jobs, there is currently only platform level

Use Case

Allowing a per device will allow operators to manage which devices are included. Often times there are technical limitations for how a device can be accessed such as device in a DMZ that requires a jump host. Additionally there are other reasons for not including in the process, such as rolling out automation site-by-site or region-by-region.

Proper Substitute Line Management

Currently substitute lines is handled as a text blob that is horribly parsed. This should be considered a first class citizen with proper configurations to it.

Deleting git repository used for backup config causes AttributeError

Environment

  • Python version: 3.7.10
  • Nautobot version: 1.0.0
  • nautobot-golden-config version: 1.0.0 (develop branch - using dev env)

Steps to Reproduce

  1. Create git repository on the UI at Extensibility -> Git Repository for config_context and backup_config
  2. Go to GoldenConfig Settings and configure backup path pointing to the newly created git repository
  3. Delete the newly created repository using the UI at Extensibility -> Git Repository
  4. Go back to the GoldenConfig Settings

Expected Behavior

Can view and reconfigure the settings for the GoldenConfig.

Observed Behavior

AttributeError raised as below.

Environment:


Request Method: GET
Request URL: http://147.75.194.238:8080/plugins/golden-config/setting/

Django Version: 3.1.8
Python Version: 3.7.10
Installed Applications:
['django.contrib.admin',
 'django.contrib.auth',
 'django.contrib.contenttypes',
 'django.contrib.sessions',
 'django.contrib.messages',
 'django.contrib.staticfiles',
 'django.contrib.humanize',
 'cacheops',
 'corsheaders',
 'django_filters',
 'django_tables2',
 'django_prometheus',
 'mptt',
 'rest_framework',
 'social_django',
 'taggit',
 'timezone_field',
 'nautobot.core',
 'nautobot.circuits',
 'nautobot.dcim',
 'nautobot.ipam',
 'nautobot.extras',
 'nautobot.tenancy',
 'nautobot.users',
 'nautobot.utilities',
 'nautobot.virtualization',
 'django_rq',
 'drf_yasg',
 'graphene_django',
 'debug_toolbar',
 'nautobot_plugin_nornir.NornirConfig',
 'nautobot_golden_config.GoldenConfig',
 'nautobot_netbox_importer.NautobotNetboxImporterConfig']
Installed Middleware:
['debug_toolbar.middleware.DebugToolbarMiddleware',
 'django_prometheus.middleware.PrometheusBeforeMiddleware',
 'corsheaders.middleware.CorsMiddleware',
 'django.contrib.sessions.middleware.SessionMiddleware',
 'django.middleware.common.CommonMiddleware',
 'django.middleware.csrf.CsrfViewMiddleware',
 'django.contrib.auth.middleware.AuthenticationMiddleware',
 'django.contrib.messages.middleware.MessageMiddleware',
 'django.middleware.clickjacking.XFrameOptionsMiddleware',
 'django.middleware.security.SecurityMiddleware',
 'nautobot.core.middleware.ExceptionHandlingMiddleware',
 'nautobot.core.middleware.RemoteUserMiddleware',
 'nautobot.core.middleware.ExternalAuthMiddleware',
 'nautobot.core.middleware.APIVersionMiddleware',
 'nautobot.core.middleware.ObjectChangeMiddleware',
 'django_prometheus.middleware.PrometheusAfterMiddleware']


Template error:
In template /usr/local/lib/python3.7/site-packages/nautobot/core/templates/base.html, error at line 27
   'NoneType' object has no attribute '_meta'
   17 :           href="{% static 'select2-4.0.13/dist/css/select2.min.css' %}"
   18 :           onerror="window.location='{% url 'media_failure' %}?filename=select2-4.0.13/dist/css/select2.min.css'">
   19 :     <link rel="stylesheet"
   20 :           href="{% static 'select2-bootstrap-0.1.0-beta.10/select2-bootstrap.min.css' %}"
   21 :           onerror="window.location='{% url 'media_failure' %}?filename=select2-bootstrap-0.1.0-beta.10/select2-bootstrap.min.css'">
   22 :     <link rel="stylesheet"
   23 :           href="{% static 'flatpickr-4.6.3/themes/light.css' %}"
   24 :           onerror="window.location='{% url 'media_failure' %}?filename=flatpickr-4.6.3/themes/light.css'">
   25 :     <link rel="stylesheet"
   26 :           href="{% static 'css/base.css' %}?v{{ settings.VERSION }}"
   27 :           onerro r="window.location='{% ur l 'media_failure' %}?filename=css/base.css'">
   28 :     <link rel="apple-touch-icon" sizes="180x180" href="{% static 'img/nautobot_icon_180x180.png' %}">
   29 :     <link rel="icon" type="image/png" sizes="32x32" href="{% static 'img/nautobot_icon_32x32.png' %}">
   30 :     <link rel="icon" type="image/png" sizes="16x16" href="{% static 'img/nautobot_icon_16x16.png' %}">
   31 :     <link rel="icon" type="image/png" href="{% static 'img/nautobot_icon_192x192.png' %}" sizes="192x192">
   32 :     <link rel="mask-icon" href="{% static 'img/nautobot_icon_monochrome.svg' %}" color="#0097ff">
   33 :     <link rel="shortcut icon" href="{% static 'img/favicon.ico' %}">
   34 :     <meta name="msapplication-TileColor" content="#2d89ef">
   35 :     <meta name="theme-color" content="#ffffff">
   36 :     <meta charset="UTF-8">
   37 :     <meta name="viewport" content="initial-scale=1, maximum-scale=1, user-scalable=no, width=device-width">


Traceback (most recent call last):
  File "/usr/local/lib/python3.7/site-packages/django/core/handlers/exception.py", line 47, in inner
    response = get_response(request)
  File "/usr/local/lib/python3.7/site-packages/django/core/handlers/base.py", line 181, in _get_response
    response = wrapped_callback(request, *callback_args, **callback_kwargs)
  File "/usr/local/lib/python3.7/site-packages/django/views/generic/base.py", line 70, in view
    return self.dispatch(request, *args, **kwargs)
  File "/usr/local/lib/python3.7/site-packages/nautobot/utilities/views.py", line 94, in dispatch
    return super().dispatch(request, *args, **kwargs)
  File "/usr/local/lib/python3.7/site-packages/django/views/generic/base.py", line 98, in dispatch
    return handler(request, *args, **kwargs)
  File "/source/nautobot_golden_config/views.py", line 679, in get
    **self.get_extra_context(request, instance),
  File "/usr/local/lib/python3.7/site-packages/django/shortcuts.py", line 19, in render
    content = loader.render_to_string(template_name, context, request, using=using)
  File "/usr/local/lib/python3.7/site-packages/django/template/loader.py", line 62, in render_to_string
    return template.render(context, request)
  File "/usr/local/lib/python3.7/site-packages/django/template/backends/django.py", line 61, in render
    return self.template.render(context)
  File "/usr/local/lib/python3.7/site-packages/django/template/base.py", line 170, in render
    return self._render(context)
  File "/usr/local/lib/python3.7/site-packages/django/test/utils.py", line 96, in instrumented_test_render
    return self.nodelist.render(context)
  File "/usr/local/lib/python3.7/site-packages/django/template/base.py", line 938, in render
    bit = node.render_annotated(context)
  File "/usr/local/lib/python3.7/site-packages/django/template/base.py", line 905, in render_annotated
    return self.render(context)
  File "/usr/local/lib/python3.7/site-packages/django/template/loader_tags.py", line 150, in render
    return compiled_parent._render(context)
  File "/usr/local/lib/python3.7/site-packages/django/test/utils.py", line 96, in instrumented_test_render
    return self.nodelist.render(context)
  File "/usr/local/lib/python3.7/site-packages/django/template/base.py", line 938, in render
    bit = node.render_annotated(context)
  File "/usr/local/lib/python3.7/site-packages/django/template/base.py", line 905, in render_annotated
    return self.render(context)
  File "/usr/local/lib/python3.7/site-packages/django/template/loader_tags.py", line 62, in render
    result = block.nodelist.render(context)
  File "/usr/local/lib/python3.7/site-packages/django/template/base.py", line 938, in render
    bit = node.render_annotated(context)
  File "/usr/local/lib/python3.7/site-packages/django/template/base.py", line 905, in render_annotated
    return self.render(context)
  File "/usr/local/lib/python3.7/site-packages/django/template/library.py", line 192, in render
    output = self.func(*resolved_args, **resolved_kwargs)
  File "/usr/local/lib/python3.7/site-packages/nautobot/extras/templatetags/custom_links.py", line 30, in custom_links
    content_type = ContentType.objects.get_for_model(obj)
  File "/usr/local/lib/python3.7/site-packages/django/contrib/contenttypes/models.py", line 40, in get_for_model
    opts = self._get_opts(model, for_concrete_model)
  File "/usr/local/lib/python3.7/site-packages/django/contrib/contenttypes/models.py", line 27, in _get_opts
    model = model._meta.concrete_model

Exception Type: AttributeError at /plugins/golden-config/setting/
Exception Value: 'NoneType' object has no attribute '_meta'

Support additional Git providers

Environment

  • Python version: 3.7.9
  • Nautobot version: v1.0.0b1
  • nautobot-golden-config version: 0.9.0

Due to https://github.com/nautobot/nautobot-plugin-golden-config/blob/09e7277c4d47890beaf0756bf5a58d7b4ef898c9/nautobot_golden_config/utilities/git.py#L25
the url built will only work in Git providers where the token is the username (GitHub). This does not work when the token is the password (Bitbucket or GitLab).

The proposed implementation is to generate the url similar to the url generated by Nautobot: https://github.com/nautobot/nautobot/blob/8868c442c2e263c1072cfc1504b99990cf78c15f/nautobot/extras/datasources/git.py#L124

SoTAgg doesn't work until database entry for the device

Environment

  • Python version: 3.8.5
  • Nautobot version: 1.0.1
  • nautobot-golden-config version: develop branch

Steps to Reproduce

  1. Install golden-config plugin
  2. Configure graphql query in Settings
  3. On a device page, click the SoT Agg link to retrieve data

Expected Behavior

Display device data in result view

Observed Behavior

Empty output. No error logs.

Subsequent execution of Execute All Golden Configuration Jobs - Single Device produced the error below.

Traceback (most recent call last):
  File "/usr/local/lib/python3.6/site-packages/nautobot/extras/jobs.py", line 826, in _run_job
    output = job.run(data=data, commit=commit)
  File "/usr/local/lib/python3.6/site-packages/nautobot_golden_config/jobs.py", line 44, in inner
    return method(obj, data, commit)
  File "/usr/local/lib/python3.6/site-packages/nautobot_golden_config/jobs.py", line 197, in run
    IntendedJob().run.__func__(self, data, True)
  File "/usr/local/lib/python3.6/site-packages/nautobot_golden_config/jobs.py", line 44, in inner
    return method(obj, data, commit)
  File "/usr/local/lib/python3.6/site-packages/nautobot_golden_config/jobs.py", line 131, in run
    jinja_repo = git_wrapper(self, GoldenConfigSetting.objects.first().jinja_repository, "jinja")
  File "/usr/local/lib/python3.6/site-packages/nautobot_golden_config/jobs.py", line 29, in git_wrapper
    raise  # pylint: disable=misplaced-bare-raise
RuntimeError: No active exception to reraise

Template Content

Environment

  • Python version:
  • Nautobot version:
  • nautobot-golden-config version:

(Details to come)

Steps to Reproduce

Expected Behavior

Observed Behavior

'NoneType' object has no attribute 'strftime'

Environment

  • Python version: 3.7.10
  • Nautobot version: 1.0.0
  • nautobot-golden-config version: 0.9.0

Steps to Reproduce

  1. Install Golden Config plugin.
  2. Setup git repositories for backup and intended. Do NOT setup templates.
  3. Run compliance job.
  4. Go to devices that succeed.
  5. Click on icon for Compliance in Configuration Types box.

Expected Behavior

See configuration status.

Observed Behavior

Get a stack trace:

Environment:

Request Method: GET
Request URL: http://localhost:8000/plugins/golden-config/config-details/device_name/compliance/

Django Version: 3.1.8
Python Version: 3.7.10
Installed Applications:
['django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
'django.contrib.humanize',
'cacheops',
'corsheaders',
'django_filters',
'django_tables2',
'django_prometheus',
'mptt',
'rest_framework',
'social_django',
'taggit',
'timezone_field',
'nautobot.core',
'nautobot.circuits',
'nautobot.dcim',
'nautobot.ipam',
'nautobot.extras',
'nautobot.tenancy',
'nautobot.users',
'nautobot.utilities',
'nautobot.virtualization',
'django_rq',
'drf_yasg',
'graphene_django',
'baxter_nautobot_api.NautobotAPIConfig',
'baxter_nautobot_common_utils.NautobotCommonUtilsConfig',
'baxter_netbox_netbuild.NautobotNetbuildConfig',
'baxter_nautobot_jobs.BaxterNautobotJobsConfig',
'nautobot_device_onboarding.OnboardingConfig',
'nautobot_plugin_nornir.NornirConfig',
'nautobot_golden_config.GoldenConfiguration']
Installed Middleware:
['django_prometheus.middleware.PrometheusBeforeMiddleware',
'corsheaders.middleware.CorsMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.common.CommonMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
'django.middleware.clickjacking.XFrameOptionsMiddleware',
'django.middleware.security.SecurityMiddleware',
'nautobot.core.middleware.ExceptionHandlingMiddleware',
'nautobot.core.middleware.RemoteUserMiddleware',
'nautobot.core.middleware.ExternalAuthMiddleware',
'nautobot.core.middleware.APIVersionMiddleware',
'nautobot.core.middleware.ObjectChangeMiddleware',
'django_prometheus.middleware.PrometheusAfterMiddleware']

Traceback (most recent call last):
File "/usr/local/lib/python3.7/site-packages/django/core/handlers/exception.py", line 47, in inner
response = get_response(request)
File "/usr/local/lib/python3.7/site-packages/django/core/handlers/base.py", line 181, in _get_response
response = wrapped_callback(request, *callback_args, **callback_kwargs)
File "/usr/local/lib/python3.7/site-packages/django/views/generic/base.py", line 70, in view
return self.dispatch(request, *args, **kwargs)
File "/usr/local/lib/python3.7/site-packages/nautobot/utilities/views.py", line 47, in dispatch
return super().dispatch(request, *args, **kwargs)
File "/usr/local/lib/python3.7/site-packages/django/views/generic/base.py", line 98, in dispatch
return handler(request, *args, **kwargs)
File "/usr/local/lib/python3.7/site-packages/nautobot_golden_config/views.py", line 104, in get
backup_date = str(config_details.backup_last_success_date.strftime("%b %d %Y"))

Exception Type: AttributeError at /plugins/golden-config/config-details/device_name/compliance/
Exception Value: 'NoneType' object has no attribute 'strftime'

Create Real Time Updates

The plugin at times can give the illusion of that everything is happening in real time. For SoT aggregation, the data is rendered live each time. For all other components, this is simply not the case. The Plugin is by design, non opinionated about the use cases and solutions. Taken from the FAQ.

The plugin make no assumptions about your intention and expects the operator to manage the configurations as they see fit. As as example, in preparation for a change, one may update data to reflect these changes, but not want to generate or run compliance against these configurations. Additionally, configurations generated would have to either update the Git Repo immediately or generate locally only and not update the Git Repo, both of which may not be as the user expected.

The current design allows for the maximum amount of use cases and make little assumptions how the user wants to manage their configurations. That being said, education about how the process works is important as inevitably any design choice will not be line with another person's pre-conceived notions. There are a myriad of technical issues to be considered before any change can be made to this process.

Proper proposals of designs will be considered, but they must describe the use cases that they are covering, even for those that are not relevant to the user.

Multiple Compliance Job Runs Won't Update Device

Environment

  • Python version: 3.7
  • Nautobot version: 1.0.1
  • nautobot-golden-config version: 0.9.1

Steps to Reproduce

  1. Install GC plugin and set it up with compliance features and rules.
    2.Run compliance job against devices.
    3.Re-run compliance job against same devices.
    4.Evaluate compliance results.

Expected Behavior

Expect to see compliance results change as corrections are made.

Observed Behavior

Doesn't happen always, but you will sometimes get an error about "Key already exists" with following traceback:

worker_1    | Traceback (most recent call last):
worker_1    |   File "/usr/local/lib/python3.7/site-packages/nornir/core/task.py", line 99, in start
worker_1    |     r = self.task(self, **self.params)
worker_1    |   File "/source/nautobot_golden_config/nornir_plays/config_compliance.py", line 112, in run_compliance
worker_1    |     intended=section_config(feature, intended_cfg, platform),
worker_1    |   File "/usr/local/lib/python3.7/site-packages/django/db/models/manager.py", line 85, in manager_method
worker_1    |     return getattr(self.get_queryset(), name)(*args, **kwargs)
worker_1    |   File "/usr/local/lib/python3.7/site-packages/django/db/models/query.py", line 594, in update_or_create
worker_1    |     obj, created = self._create_object_from_params(kwargs, params, lock=True)
worker_1    |   File "/usr/local/lib/python3.7/site-packages/django/db/models/query.py", line 610, in _create_object_from_params
worker_1    |     obj = self.create(**params)
worker_1    |   File "/usr/local/lib/python3.7/site-packages/django/db/models/query.py", line 447, in create
worker_1    |     obj.save(force_insert=True, using=self.db)
worker_1    |   File "/source/nautobot_golden_config/models.py", line 217, in save
worker_1    |     super().save(*args, **kwargs)
worker_1    |   File "/usr/local/lib/python3.7/site-packages/django/db/models/base.py", line 754, in save
worker_1    |     force_update=force_update, update_fields=update_fields)
worker_1    |   File "/usr/local/lib/python3.7/site-packages/django/db/models/base.py", line 792, in save_base
worker_1    |     force_update, using, update_fields,
worker_1    |   File "/usr/local/lib/python3.7/site-packages/django/db/models/base.py", line 895, in _save_table
worker_1    |     results = self._do_insert(cls._base_manager, using, fields, returning_fields, raw)
worker_1    |   File "/usr/local/lib/python3.7/site-packages/django/db/models/base.py", line 935, in _do_insert
worker_1    |     using=using, raw=raw,
worker_1    |   File "/usr/local/lib/python3.7/site-packages/django/db/models/manager.py", line 85, in manager_method
worker_1    |     return getattr(self.get_queryset(), name)(*args, **kwargs)
worker_1    |   File "/usr/local/lib/python3.7/site-packages/django/db/models/query.py", line 1254, in _insert
worker_1    |     return query.get_compiler(using=using).execute_sql(returning_fields)
worker_1    |   File "/usr/local/lib/python3.7/site-packages/django/db/models/sql/compiler.py", line 1397, in execute_sql
worker_1    |     cursor.execute(sql, params)
worker_1    |   File "/usr/local/lib/python3.7/site-packages/django/db/backends/utils.py", line 98, in execute
worker_1    |     return super().execute(sql, params)
worker_1    |   File "/usr/local/lib/python3.7/site-packages/cacheops/transaction.py", line 93, in execute
worker_1    |     result = self._no_monkey.execute(self, sql, params)
worker_1    |   File "/usr/local/lib/python3.7/site-packages/django/db/backends/utils.py", line 66, in execute
worker_1    |     return self._execute_with_wrappers(sql, params, many=False, executor=self._execute)
worker_1    |   File "/usr/local/lib/python3.7/site-packages/django/db/backends/utils.py", line 75, in _execute_with_wrappers
worker_1    |     return executor(sql, params, many, context)
worker_1    |   File "/usr/local/lib/python3.7/site-packages/django/db/backends/utils.py", line 84, in _execute
worker_1    |     return self.cursor.execute(sql, params)
worker_1    |   File "/usr/local/lib/python3.7/site-packages/django/db/utils.py", line 90, in __exit__
worker_1    |     raise dj_exc_value.with_traceback(traceback) from exc_value
worker_1    |   File "/usr/local/lib/python3.7/site-packages/django/db/backends/utils.py", line 84, in _execute
worker_1    |     return self.cursor.execute(sql, params)
worker_1    | django.db.utils.IntegrityError: duplicate key value violates unique constraint "nautobot_golden_config_c_device_id_rule_id_bad42baf_uniq"
worker_1    | DETAIL:  Key (device_id, rule_id)=(2d957379-8650-578d-ac20-9da365f861c9, b1dc6c9b-466d-41b5-b816-5f5b22d7e8e0) already exists.

Doc Update - Executing a Backup Job

Environment

  • Python version: 3.9
  • Nautobot version: 1.1.0
  • nautobot-golden-config version: 0.9.5

Steps to Reproduce

  1. Install plugin
  2. Attempt to figure out how to launch a config backup
  3. Get in touch with those in the know

Expected Behavior

Docs to cover this

Observed Behavior

I reached out and disturbed someone's train of thought

I have some minor doc updates ready for this

Proper Remove Line Management

Currently remove lines is handled as a text blob. This should be considered a first class citizen with proper configurations to it.

Hover Icon

Hover on icons on the home page does not switch to a pointer within the Home page icons for backup, intended, etc.

Pushing Config Backup git repository fails

Environment

  • Python version: 3.7.3
  • Nautobot version: development-branch from ~ 2020-03-08T16:00:00 UTC
  • nautobot-golden-config version: 0.9.0

Steps to Reproduce

  1. Configure a git repository (in a self hosted gitlab instance)
  2. Run a Backup Job

Expected Behavior

The Backup Config git repo gets pushed.

Observed Behavior

The process fails with an error after making the config backup:

An exception occurred: GitCommandError: Cmd('git') failed due to: exit code(128) cmdline: git push --porcelain origin stderr: 'fatal: Authentication failed for 'https://<key here>:[email protected]/someuser/nautobot-tests.git/''

Traceback (most recent call last):
  File "/opt/nautobot/lib/python3.7/site-packages/nautobot/extras/jobs.py", line 826, in _run_job
    output = job.run(data=data, commit=commit)
  File "/opt/nautobot/lib/python3.7/site-packages/nautobot_golden_config/jobs.py", line 53, in inner
    return method(obj, data, commit)
  File "/opt/nautobot/lib/python3.7/site-packages/nautobot_golden_config/jobs.py", line 187, in run
    backup_repo.push()
  File "/opt/nautobot/lib/python3.7/site-packages/nautobot_golden_config/utilities/git.py", line 56, in push
    self.repo.remotes.origin.push()
  File "/opt/nautobot/lib/python3.7/site-packages/git/remote.py", line 848, in push
    return self._get_push_info(proc, progress)
  File "/opt/nautobot/lib/python3.7/site-packages/git/remote.py", line 735, in _get_push_info
    proc.wait(stderr=stderr_text)
  File "/opt/nautobot/lib/python3.7/site-packages/git/cmd.py", line 408, in wait
    raise GitCommandError(self.args, status, errstr)
git.exc.GitCommandError: Cmd('git') failed due to: exit code(128)
  cmdline: git push --porcelain origin
  stderr: 'fatal: Authentication failed for 'https://<key here>:[email protected]/someuser/nautobot-tests.git/''

Pulling the repo works. Also the username for that repo is not x-oauth-basic, sounds wrong to me, but I have no idea how the gitlab API works. The access token has write access to the repo.

Add filter / targeting to compliancies

Environment

  • Python version: 3.7.1
  • Nautobot version: 1.0.0b4
  • nautobot-golden-config version: develop

Proposed Functionality

At this moment the complancies are based on platform, so all devices from the same platfrom are targeted to the same compliancy ruleset. Add more options to filter the targeting

Use Case

When having several Cisco IOS devices in different parts of the network, they often have other compliancy rules that needed to comply.

For example:
For the Access switches (eg device role: 'access') must have TenGig1/1 and TenGig1/2 as uplink with several settings. And all access ports needs to have CDP disabled. But the distribution switches must have CDP/LLDP enables on all interfaces. This is also for security settings etc. And for devices in planned state the compliancy are minimal, disabled state does not have to apply. Also with tags for example skip check fo tag: 'development'

A minimal filter to apply to device_role and device_state will help a lot to differentiate the compliancy rules

Device Without Platform Causes Crash

Environment

  • Python version: 3.7
  • Nautobot version: 1.0.1
  • nautobot-golden-config version: 0.9.1

Steps to Reproduce

  1. Install Golden Config plugin and configure required settings for backups and intended.
  2. Ensure a device without a platform is in Nautobot.
  3. Attempt to run compliance job against that device.

Expected Behavior

Expect an error about needing a platform set.

Observed Behavior

Job crashes with error:

worker_1    | 23:31:14 ERROR An exception occurred: `KeyError: 'platform'`
worker_1    | ```
worker_1    | Traceback (most recent call last):
worker_1    |   File "/usr/local/lib/python3.7/site-packages/nautobot/extras/jobs.py", line 826, in _run_job
worker_1    |     output = job.run(data=data, commit=commit)
worker_1    |   File "/source/nautobot_golden_config/jobs.py", line 44, in inner
worker_1    |     return method(obj, data, commit)
worker_1    |   File "/source/nautobot_golden_config/jobs.py", line 100, in run
worker_1    |     config_compliance(self, data, backup_repo.path, intended_repo.path)
worker_1    |   File "/source/nautobot_golden_config/nornir_plays/config_compliance.py", line 131, in config_compliance
worker_1    |     "defaults": {"now": now},
worker_1    |   File "/usr/local/lib/python3.7/site-packages/nornir/init_nornir.py", line 64, in InitNornir
worker_1    |     inventory=load_inventory(config),
worker_1    |   File "/usr/local/lib/python3.7/site-packages/nornir/init_nornir.py", line 18, in load_inventory
worker_1    |     inv = inventory_plugin(**config.inventory.options).load()
worker_1    |   File "/usr/local/lib/python3.7/site-packages/nautobot_plugin_nornir/plugins/inventory/nautobot_orm.py", line 118, in load
worker_1    |     data=host["data"], name=host["name"], groups=host["groups"], host=host, defaults=defaults
worker_1    |   File "/usr/local/lib/python3.7/site-packages/nautobot_plugin_nornir/plugins/inventory/nautobot_orm.py", line 38, in _set_host
worker_1    |     platform=host["platform"],
worker_1    | KeyError: 'platform'

Git Username/Password not properly escaped in plugin jobs

Environment

  • Python version: 3.6
  • Nautobot version: 1.0.3
  • nautobot-golden-config version: 0.9.4

Steps to Reproduce

  1. Configure a Nautobot Git Repo where the username contains an @
  2. Do a config backup operation that utilizes the Git repo
  3. The backup succeeds but pushing to git will fail due to the git repo username not being escaped properly

Expected Behavior

Backup to be pushed to Git

Observed Behavior

Backup fails to push to git.

The git remote changes after the plugin job triggers. Prior to triggering the job, the git remote has a properly escaped username. After the job runs, the git origin changes to the 'raw' username which will not work.

graphql in extras_features in models.py need to be removed since custom types were created.

Environment

  • Python version: 3.9
  • Nautobot version: 1.0.3
  • nautobot-golden-config version: 0.9.5

graphql in extras_features in models.py need to be removed since custom types were created.

Steps to Reproduce

  1. invoke debug
  2. look for the errors that are occuring.

Expected Behavior

No errors seen in logs.

Observed Behavior

nautobot_1  | 20:13:38 WARNING Unable to load schema type for the model "nautobot_golden_config.configcompliance" as there is already another type registered under this name. If you are seeing this message during plugin development, check to make sure that you aren't using @extras_features("graphql") on the same model you're also defining a custom GraphQL type for. - nautobot.graphql.schema - schema - /usr/local/lib/python3.7/site-packages/nautobot/core/graphql/schema.py:319
nautobot_1  | 20:13:38 WARNING Unable to load schema type for the model "nautobot_golden_config.goldenconfig" as there is already another type registered under this name. If you are seeing this message during plugin development, check to make sure that you aren't using @extras_features("graphql") on the same model you're also defining a custom GraphQL type for. - nautobot.graphql.schema - schema - /usr/local/lib/python3.7/site-packages/nautobot/core/graphql/schema.py:319
nautobot_1  | 20:13:38 WARNING Unable to load schema type for the model "nautobot_golden_config.compliancerule" as there is already another type registered under this name. If you are seeing this message during plugin development, check to make sure that you aren't using @extras_features("graphql") on the same model you're also defining a custom GraphQL type for. - nautobot.graphql.schema - schema - /usr/local/lib/python3.7/site-packages/nautobot/core/graphql/schema.py:319
nautobot_1  | 20:13:38 WARNING Unable to load schema type for the model "nautobot_golden_config.configremove" as there is already another type registered under this name. If you are seeing this message during plugin development, check to make sure that you aren't using @extras_features("graphql") on the same model you're also defining a custom GraphQL type for. - nautobot.graphql.schema - schema - /usr/local/lib/python3.7/site-packages/nautobot/core/graphql/schema.py:319
nautobot_1  | 20:13:38 WARNING Unable to load schema type for the model "nautobot_golden_config.configreplace" as there is already another type registered under this name. If you are seeing this message during plugin development, check to make sure that you aren't using @extras_features("graphql") on the same model you're also defining a custom GraphQL type for. - nautobot.graphql.schema - schema - /usr/local/lib/python3.7/site-packages/nautobot/core/graphql/schema.py:319
nautobot_1  | 20:13:42 WARNING Unable to register the schema type 'interface' in GraphQL from 'nautobot_golden_config':'configreplace',there is already another type registered under this name - nautobot.graphql.schema - schema - /usr/local/lib/python3.7/site-packages/nautobot/core/graphql/schema.py:273

Status Filtering on Home and Config Compliance does not work

Environment

  • Python version: 3.7
  • Nautobot version: 1.0
  • nautobot-golden-config version: 0.9

Steps to Reproduce

  1. View forms searching for ConfigFeature (as an example)
  2. View the search capability

Expected Behavior

The search form to match the common search parameters.

Observed Behavior

Randomly included fields.

Note: this was originally an investigation, the only he following not filtering correctly.

  • Configuration Compliance - Status
  • Home - Status
  • ComplianceRule - Name
  • ConfigRemove - Name
  • ConfigReplace - Name

Compliance object has no groupdict attribute

Environment

  • Python version: 3.7.10
  • Nautobot version: 1.0.0
  • nautobot-golden-config version: 0.9.0

Steps to Reproduce

  1. Install Golden Config plugin.
  2. Setup Git repositories for backup and intended configurations. Do not use templates.
  3. Attempt a configuration compliance run.

Expected Behavior

Expect the job to complete successfully and evaluate the compliance of backup against intended.

Observed Behavior

Error occurs: "UNKNOWN Failure of: 'NoneType' object has no attribute 'groupdict'"

Compliance Overview Reports

The Compliance overview reports currently take in static definitions to define sizing. Will need to evaluate alternative solutions.

Vendor CLI Matching

While this is technically based on nornir_nautobot, based on the usage, I think it is fair to discuss here.

This issue was specifically open as the first. I fully expect there to be a lot of confusion over this topic, so wanted to highlight the reasoning.

A vendor processes configuration understanding constructs such as knowing that int g0/0 and interface GigabitEthernet0/0 are the same. Each one of these rules a subject to a given vendor's OS implementation. The ability to track these changes for all vendors/OS/versions is nearly impossible. Additionally, this practice would be error prone and not follow the principal of least astonishment. Notwithstanding a major change in the network industry, adjusting this strategy is outside the scope of the plugin.

Instead, it is up to the operator to ensure their configurations match exactly as the configurations show in the running configuration.

The barrier of entry to change this process will be high. The solution in its current form has proven to work. That being said, if a reasonable solution is found a Python module that lives outside of this project, feel free to make suggestions.

IOS-XR Support

Environment

  • Python version: 3.8
  • Nautobot version: 1.0.1
  • nautobot-golden-config version: develop

Proposed Functionality

Add a parser for IOSXR

Use Case

Already seen it be requested a few times in public chat

Hash Reports

Environment

  • Python version: 3.7
  • Nautobot version: 1.0
  • nautobot-golden-config version: 0.9

Proposed Functionality

The ability to role up similar configuration issues that are applied to multiple devices. Each text field can be represented by a hash value. If we can capture the hash value at entry, we can quickly count the hash values to understand what common issues are.

Use Case

The understanding of configuration compliance issues from a highest impact to least impact issue.

Ability to Filter Primary Member of Virtual Chassis

Environment

  • Python version: 3.7.10
  • Nautobot version: 1.0.0
  • nautobot-golden-config version: 0.9.0

Proposed Functionality

As an end-user with multiple virtual chassis clusters in Nautobot, it'd be helpful to be able to filter devices for compliance based upon having a primary IP address or being the primary member of a virtual chassis.

Use Case

When you attempt to run a compliance job, all secondary members of a virtual chassis are run against unnecessarily. It'd be great to be able to filter those out somehow.

Docker Container Incorrectly Named

Environment

  • Python version: 3.7
  • Nautobot version: 1.0.1
  • nautobot-golden-config version: 0.9.1

Steps to Reproduce

  1. Clone Golden Config plugin repo.
  2. Perform poetry shell, poetry install, and invoke build.
  3. Evaluate the name of the container image that is created.

Expected Behavior

The container to be named nautobot-golden-config.

Observed Behavior

The container is named nautobot_circuit_maintenance.

Setting only Backup to true in config cannot load settings page.

Environment

  • Python version: 3.7
  • Nautobot version: 1.0.1
  • nautobot-golden-config version: Example: 1.0.0

Steps to Reproduce

  1. In configuration for the plugin set all options to False except for Backup which is set to True.
  2. Set git repo for backups.
  3. Go to Plugins -->Settings (under golden configuration).

Expected Behavior

Loads setting page to allow for putting in Backup details.

Observed Behavior

Error message:

Traceback (most recent call last):
  File "/usr/local/lib/python3.7/site-packages/django/core/handlers/exception.py", line 47, in inner
    response = get_response(request)
  File "/usr/local/lib/python3.7/site-packages/django/core/handlers/base.py", line 181, in _get_response
    response = wrapped_callback(request, *callback_args, **callback_kwargs)
  File "/usr/local/lib/python3.7/site-packages/django/views/generic/base.py", line 70, in view
    return self.dispatch(request, *args, **kwargs)
  File "/usr/local/lib/python3.7/site-packages/nautobot/utilities/views.py", line 94, in dispatch
    return super().dispatch(request, *args, **kwargs)
  File "/usr/local/lib/python3.7/site-packages/django/views/generic/base.py", line 98, in dispatch
    return handler(request, *args, **kwargs)
  File "/source/nautobot_golden_config/views.py", line 679, in get
    **self.get_extra_context(request, instance),
  File "/usr/local/lib/python3.7/site-packages/django/shortcuts.py", line 19, in render
    content = loader.render_to_string(template_name, context, request, using=using)
  File "/usr/local/lib/python3.7/site-packages/django/template/loader.py", line 62, in render_to_string
    return template.render(context, request)
  File "/usr/local/lib/python3.7/site-packages/django/template/backends/django.py", line 61, in render
    return self.template.render(context)
  File "/usr/local/lib/python3.7/site-packages/django/template/base.py", line 170, in render
    return self._render(context)
  File "/usr/local/lib/python3.7/site-packages/django/test/utils.py", line 96, in instrumented_test_render
    return self.nodelist.render(context)
  File "/usr/local/lib/python3.7/site-packages/django/template/base.py", line 938, in render
    bit = node.render_annotated(context)
  File "/usr/local/lib/python3.7/site-packages/django/template/base.py", line 905, in render_annotated
    return self.render(context)
  File "/usr/local/lib/python3.7/site-packages/django/template/loader_tags.py", line 150, in render
    return compiled_parent._render(context)
  File "/usr/local/lib/python3.7/site-packages/django/test/utils.py", line 96, in instrumented_test_render
    return self.nodelist.render(context)
  File "/usr/local/lib/python3.7/site-packages/django/template/base.py", line 938, in render
    bit = node.render_annotated(context)
  File "/usr/local/lib/python3.7/site-packages/django/template/base.py", line 905, in render_annotated
    return self.render(context)
  File "/usr/local/lib/python3.7/site-packages/django/template/loader_tags.py", line 62, in render
    result = block.nodelist.render(context)
  File "/usr/local/lib/python3.7/site-packages/django/template/base.py", line 938, in render
    bit = node.render_annotated(context)
  File "/usr/local/lib/python3.7/site-packages/django/template/base.py", line 905, in render_annotated
    return self.render(context)
  File "/usr/local/lib/python3.7/site-packages/django/template/library.py", line 192, in render
    output = self.func(*resolved_args, **resolved_kwargs)
  File "/usr/local/lib/python3.7/site-packages/nautobot/extras/templatetags/custom_links.py", line 30, in custom_links
    content_type = ContentType.objects.get_for_model(obj)
  File "/usr/local/lib/python3.7/site-packages/django/contrib/contenttypes/models.py", line 40, in get_for_model
    opts = self._get_opts(model, for_concrete_model)
  File "/usr/local/lib/python3.7/site-packages/django/contrib/contenttypes/models.py", line 27, in _get_opts
    model = model._meta.concrete_model

Exception Type: AttributeError at /plugins/golden-config/setting/
Exception Value: 'NoneType' object has no attribute '_meta'

The error when executing a backup job is:

Traceback (most recent call last):
  File "/usr/local/lib/python3.7/site-packages/nautobot/extras/jobs.py", line 826, in _run_job
    output = job.run(data=data, commit=commit)
  File "/source/nautobot_golden_config/jobs.py", line 44, in inner
    return method(obj, data, commit)
  File "/source/nautobot_golden_config/jobs.py", line 171, in run
    backup_repo = git_wrapper(self, GoldenConfigSetting.objects.first().backup_repository, "backup")
AttributeError: 'NoneType' object has no attribute 'backup_repository'

Error executing tasks (backup/compliancy)-> possible authentication or unknown errors

Environment

  • Python version: 3.7.3
  • Nautobot version: 1.0.0b4
  • nautobot-golden-config version: 0.1.0
  • nautobot-plugin-nornir: 0.9.0

First check that NAPALM is working correctly by navigating to Devices > Device and get running-config
Also check that Nornir plugin is added.
Check if correct git repositories exist and can be synced
After configuring this plugin with correct settings, Git repositories etc, try to run a backup task. That fails

Steps to Reproduce

  1. Go Plugins -> [Golden configration] Home
  2. Click on Execute
  3. Select Backup
  4. Go to bottom and click Run Job

Expected Behavior

Backup OK

Observed Behavior

Error failed

Failed with a unknown issue. Failed to enter enable mode. Please ensure you pass the 'secret' argument to ConnectHandler.

Problem

The problem was that the Platform slug name was not wat expected.
I had ios for Cisco IOS devices, but the plugin expect cisco_ios or cisco_iosxr as slug name

Maybe a solution to use the NAPALM driver field as that field must be correct for NAPALM also to work.
My solution now was to change Platform slug_names

Failed to install in nautobot as a plugin

Environment

  • Python version: 3.7.10
  • Nautobot version: 1.0.0b1
  • nautobot-golden-config version: 0.9.0

Steps to Reproduce

  1. Add the following two lines to nautobot/development/Dockerfile (from project nautobot) after RUN poetry install

    [...]
    COPY . /opt/nautobot
    
    RUN poetry install
    
    # vvvvvvvvv add vvvvvvvv
    RUN poetry add nautobot-plugin-nornir
    RUN poetry add nautobot-plugin-golden-config
    
  2. Execute invoke build

Expected Behavior

Plugin should be installed

Observed Behavior

Error after finished installing nautobot-plugin-nornir (0.9.0) when trying to install RUN poetry add nautobot-plugin-golden-config

  • Installing nautobot-plugin-nornir (0.9.0)
Removing intermediate container 71ff235edfee
 ---> e256fc830400
Step 16/17 : RUN poetry add nautobot-plugin-golden-config
 ---> Running in 50c7293d3f1f
Skipping virtualenv creation, as specified in config file.

  ValueError

  Could not find a matching version of package nautobot-plugin-golden-config

  at ~/.poetry/lib/poetry/console/commands/init.py:368 in _find_best_version_for_package
      364│ 
      365│         if not package:
      366│             # TODO: find similar
      367│             raise ValueError(
    → 368│                 "Could not find a matching version of package {}".format(name)
      369│             )
      370│ 
      371│         return package.pretty_name, selector.find_recommended_require_version(package)
      372│ 

Make Scope Filter help more clear

Environment

  • Python version:
  • Nautobot version:
  • nautobot-golden-config version: 0.9.4

The device Scope filter help text currently states it is expecting a Query Filter as input. A query filter does not properly validate as the field is expecting an API formatted filter which is different from a Django Query Filter. This issue is to change the helper text. The help doc properly describes how to build the query but the help text is currently misleading at best.

Device Name Dependency

Currently there is a limitation that device names must be unique. Need to evaluate solutions

unable to install golden config plugin - is_truthy error

Environment

  • Python version: 3.8
  • Nautobot version: 1.01b2
  • nautobot-golden-config version: nautobot-golden-config-0.9.0

Steps to Reproduce

  1. followed instructions at https://github.com/nautobot/nautobot-plugin-golden-config
  2. after editing the configuration file "nautobot_configuration.py" and adding the applicable lines (from the above link"

Expected Behavior

Expected the plugin to load...

Observed Behavior

Traceback (most recent call last):
File "/opt/nautobot/lib/python3.8/site-packages/nautobot/core/runner/importer.py", line 67, in validate
execfile(self.config_path, {"file": self.config_path})
File "/opt/nautobot/lib/python3.8/site-packages/nautobot/core/runner/importer.py", line 22, in execfile
exec(fh.read(), globalz, localz)
File "", line 231, in
NameError: name 'is_truthy' is not defined

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/opt/nautobot/bin/nautobot-server", line 8, in
sys.exit(main())
File "/opt/nautobot/lib/python3.8/site-packages/nautobot/core/cli.py", line 56, in main
run_app(
File "/opt/nautobot/lib/python3.8/site-packages/nautobot/core/runner/runner.py", line 263, in run_app
configure_app(config_path=config_path, **kwargs)
File "/opt/nautobot/lib/python3.8/site-packages/nautobot/core/runner/runner.py", line 133, in configure_app
importer.install(
File "/opt/nautobot/lib/python3.8/site-packages/nautobot/core/runner/importer.py", line 43, in install
sys.meta_path.append(LoganImporter(name, config_path, default_settings, **kwargs))
File "/opt/nautobot/lib/python3.8/site-packages/nautobot/core/runner/importer.py", line 58, in init
self.validate()
File "/opt/nautobot/lib/python3.8/site-packages/nautobot/core/runner/importer.py", line 70, in validate
raise ConfigurationError(unicode(e), exc_info[2])
nautobot.core.runner.importer.ConfigurationError: ("name 'is_truthy' is not defined", <traceback object at 0x7fead05b5d80>)

AttributeError Caused by Missing Backup/Intended Config

Environment

  • Python version: 3.7
  • Nautobot version: 1.0.1
  • nautobot-golden-config version: 0.9.1

Steps to Reproduce

  1. Install GC plugin and set up backups and intended settings.
  2. Setup Compliance features and rules.
  3. Run compliance job against device with missing backup or intended config.

Expected Behavior

See error about missing backup or intended config file.

Observed Behavior

Compliance task render fails with following traceback:

worker_1    | Traceback (most recent call last):
worker_1    |   File "/usr/local/lib/python3.7/site-packages/nornir/core/task.py", line 99, in start
worker_1    |     r = self.task(self, **self.params)
worker_1    |   File "/source/nautobot_golden_config/nornir_plays/config_compliance.py", line 104, in run_compliance
worker_1    |     intended=section_config(feature, intended_cfg, platform),
worker_1    |   File "/usr/local/lib/python3.7/site-packages/netutils/config/compliance.py", line 411, in section_config
worker_1    |     config_parsed = os_parser(device_cfg)
worker_1    |   File "/usr/local/lib/python3.7/site-packages/netutils/config/parser.py", line 492, in __init__
worker_1    |     super(IOSConfigParser, self).__init__(config)
worker_1    |   File "/usr/local/lib/python3.7/site-packages/netutils/config/parser.py", line 429, in __init__
worker_1    |     super(CiscoConfigParser, self).__init__(config)
worker_1    |   File "/usr/local/lib/python3.7/site-packages/netutils/config/parser.py", line 47, in __init__
worker_1    |     super(BaseSpaceConfigParser, self).__init__(config)
worker_1    |   File "/usr/local/lib/python3.7/site-packages/netutils/config/parser.py", line 25, in __init__
worker_1    |     self.generator_config = (line for line in self.config_lines_only.splitlines())
worker_1    |   File "/usr/local/lib/python3.7/site-packages/netutils/config/parser.py", line 131, in config_lines_only
worker_1    |     for line in self.config.splitlines()
worker_1    | AttributeError: 'bool' object has no attribute 'splitlines'

Job Fails ungracefully when Device query is empty

Environment

  • Python version: 3.6
  • Nautobot version:
  • nautobot-golden-config version:

Steps to Reproduce

  1. Pick a device that does not match the scope
  2. See 'platform key error' when Device attempts to be loaded

Screen Shot 2021-08-10 at 10 32 39

Expected Behavior

Expect either No devices found, no device that matches scope found, or something more verbose

Observed Behavior

Key error.

Predefined Configurations

The idea of pre-defining configurations such as:

  • Feature maps
  • Remove Lines
  • Substitute Lines
  • Queries

Provides too strong of an opinion to the users and would burden the project to a crawl. This is not a task that can reasonably handled be the project.

Jobs MultiObjectVar Query Params

Environment

  • Python version: 3.7
  • Nautobot version: 1.0
  • nautobot-golden-config version: 0.9

Proposed Functionality

The ability for jobs to filter based on query parameters, and then additionally, the ability for jobs to filter based on the "Home View" filtering.

Use Case

When a user goes to run a job from, they likely have an expectation that the filtering will carry over.

This issue is currently blocked by Nautobot supporting such features for MultiObjectVar.

Application Configurations

Currently the application configuration is work around, with a predefined uuid. Need to evaluate alternative solutions.

Compliance on Unstructured Data

Environment

  • Python version: 3.7
  • Nautobot version: 1.0
  • nautobot-golden-config version: 0.9

Proposed Functionality

Currently the golden configuration's primary use case is covering the CLI use case. This does not cover the structured data use case of compliance.

Use Case

Leveraging modern API based services, to provide structured data compliance in a similar way to what the cli system currently provides.

@whitej6 is already doing some work in this area, would like to get his insight/input/help if possible.

Support Environment Vars `NAUTOBOT_NAPALM_USERNAME` and `NAUTOBOT_NAPALM_PASSWORD`

Environment

  • Python version: 3.9
  • Nautobot version: 1.1.0
  • nautobot-golden-config version: 0.9.5

Proposed Functionality

As part of several environments the NAPALM credentials are often passed in as NAUTOBOT_NAPALM_USERNAME and NAUTOBOT_NAPALM_PASSWORD. Supporting these in addition to NAPALM_USERNAME and NAPALM_PASSWORD will simplify environment settings.

Use Case

As part of several environments the NAPALM credentials are often passed in as NAUTOBOT_NAPALM_USERNAME and NAUTOBOT_NAPALM_PASSWORD. Supporting these in addition to NAPALM_USERNAME and NAPALM_PASSWORD will simplify environment settings.

upgrade to 0.9.2 broke

Environment

  • Python version: 3.6
  • Nautobot version: 1.0.2
  • nautobot-golden-config version: 0.9.2
  • postgresql version: 13

Getting the below error, when I go to the plugins -> settings page.

Screenshot 2021-05-25 at 11 40 26 AM


[::[email protected] ~]$ nautobot-server migrate
Operations to perform:
  Apply all migrations: admin, auth, circuits, contenttypes, dcim, extras, ipam, nautobot_device_onboarding, nautobot_golden_config, sessions, social_django, taggit, tenancy, users, virtualization
Running migrations:
  No migrations to apply.
[::[email protected] ~]$ nautobot-server post_upgrade
Performing database migrations...
Operations to perform:
  Apply all migrations: admin, auth, circuits, contenttypes, dcim, extras, ipam, nautobot_device_onboarding, nautobot_golden_config, sessions, social_django, taggit, tenancy, users, virtualization
Running migrations:
  No migrations to apply.

Generating cable paths...
Found no missing circuit termination paths; skipping
Found no missing console port paths; skipping
Found no missing console server port paths; skipping
Found no missing interface paths; skipping
Found no missing power feed paths; skipping
Found no missing power outlet paths; skipping
Found no missing power port paths; skipping
Finished.

Collecting static files...

0 static files copied to '/opt/nautobot/static', 960 unmodified.

Removing stale content types...

Removing expired sessions...

Invalidating cache...```

Templar Feature

Environment

  • Python version: 3.7
  • Nautobot version: 1.0
  • nautobot-golden-config version: 0.9

Proposed Functionality

Ansible has the "Templar" functionality that allows variables to refer to other variables via Jinja, such as:

output_root_dir: "{{ playbook_dir | dirname }}/output/"

Providing this and potentially access to Jinja filters could be a powerful feature.

Use Case

This referenced data allows users to limit the amount of redundancy and expand "data" in a sane way.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.