Skip to content

Commit

Permalink
Cookie updated by NetworkToCode Cookie Drift Manager Tool
Browse files Browse the repository at this point in the history
Template:

```
{
    "template": "https://github.com/nautobot/cookiecutter-nautobot-app.git",
    "dir": "nautobot-app",
    "ref": "refs/tags/nautobot-app-v2.1.0",
    "path": null
}
```

Cookie:

```
{
    "remote": "https://github.com/nautobot/nautobot-app-golden-config.git",
    "path": "/tmp/tmp1woi9xuq/nautobot-app-golden-config",
    "repository_path": "/tmp/tmp1woi9xuq/nautobot-app-golden-config",
    "dir": "",
    "branch_prefix": "drift-manager",
    "context": {
        "codeowner_github_usernames": "@itdependsnetworks @jeffkala @nkallergis",
        "full_name": "Network to Code, LLC",
        "email": "[email protected]",
        "github_org": "nautobot",
        "app_name": "nautobot_golden_config",
        "verbose_name": "Golden Config",
        "app_slug": "nautobot-golden-config",
        "project_slug": "nautobot-app-golden-config",
        "repo_url": "https://github.com/nautobot/nautobot-app-golden-config",
        "base_url": "golden-config",
        "min_nautobot_version": "2.0.0",
        "max_nautobot_version": "2.9999",
        "camel_name": "NautobotGoldenConfig",
        "project_short_description": "An app for configuration on nautobot",
        "model_class_name": "None",
        "open_source_license": "Apache-2.0",
        "docs_base_url": "https://docs.nautobot.com",
        "docs_app_url": "https://docs.nautobot.com/projects/golden-config/en/latest",
        "_template": "https://github.com/nautobot/cookiecutter-nautobot-app.git",
        "_output_dir": "/tmp/tmp1woi9xuq",
        "_repo_dir": "/github/home/.cookiecutters/cookiecutter-nautobot-app/nautobot-app",
        "_checkout": "refs/tags/nautobot-app-v2.1.0"
    },
    "base_branch": "develop",
    "remote_name": "origin",
    "pull_request_strategy": "PullRequestStrategy.CREATE",
    "post_actions": [
        "PostAction.BLACK"
    ],
    "baked_commit_ref": "c6963e367d835faf66a9f4ac63267b6ce5811577",
    "draft": true
}
```

CLI Arguments:

```
{
    "cookie_dir": "",
    "input": false,
    "json_filename": "",
    "output_dir": "",
    "push": true,
    "template": "",
    "template_dir": "",
    "template_ref": "refs/tags/nautobot-app-v2.1.0",
    "pull_request": null,
    "post_action": [],
    "disable_post_actions": false,
    "draft": null
}
```
  • Loading branch information
bakebot committed Jan 29, 2024
1 parent 54d2829 commit a549059
Show file tree
Hide file tree
Showing 26 changed files with 434 additions and 479 deletions.
4 changes: 2 additions & 2 deletions .cookiecutter.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,15 @@
"_drift_manager": {
"template": "https://github.com/nautobot/cookiecutter-nautobot-app.git",
"template_dir": "nautobot-app",
"template_ref": "develop",
"template_ref": "refs/tags/nautobot-app-v2.1.0",
"cookie_dir": "",
"branch_prefix": "drift-manager",
"pull_request_strategy": "create",
"post_actions": [
"black"
],
"draft": true,
"baked_commit_ref": "c6963e367d835faf66a9f4ac63267b6ce5811577"
"baked_commit_ref": "c9dce46b70f0154a56974587202e71e82ef08bae"
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion .github/PULL_REQUEST_TEMPLATE/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<!--
Thank you for your interest in contributing to Nautobot! Please note
Thank you for your interest in contributing to Golden Config! Please note
that our contribution policy recommends that a feature request or bug
report be opened for approval prior to filing a pull request. This
helps avoid wasting time and effort on something that we might not
Expand Down
49 changes: 40 additions & 9 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ on: # yamllint disable-line rule:truthy rule:comments
pull_request: ~

env:
PLUGIN_NAME: "nautobot-app-golden-config"
APP_NAME: "nautobot-app-golden-config"

jobs:
black:
Expand All @@ -39,7 +39,7 @@ jobs:
uses: "networktocode/gh-action-setup-poetry-environment@v4"
- name: "Linting: bandit"
run: "poetry run invoke bandit"
pydocstyle:
ruff:
runs-on: "ubuntu-22.04"
env:
INVOKE_NAUTOBOT_GOLDEN_CONFIG_LOCAL: "True"
Expand All @@ -48,8 +48,19 @@ jobs:
uses: "actions/checkout@v4"
- name: "Setup environment"
uses: "networktocode/gh-action-setup-poetry-environment@v4"
- name: "Linting: pydocstyle"
run: "poetry run invoke pydocstyle"
- name: "Linting: ruff"
run: "poetry run invoke ruff"
check-docs-build:
runs-on: "ubuntu-22.04"
env:
INVOKE_NAUTOBOT_GOLDEN_CONFIG_LOCAL: "True"
steps:
- name: "Check out repository code"
uses: "actions/checkout@v4"
- name: "Setup environment"
uses: "networktocode/gh-action-setup-poetry-environment@v4"
- name: "Check Docs Build"
run: "poetry run invoke build-and-check-docs"
flake8:
runs-on: "ubuntu-22.04"
env:
Expand Down Expand Up @@ -97,7 +108,7 @@ jobs:
pylint:
needs:
- "bandit"
- "pydocstyle"
- "ruff"
- "flake8"
- "poetry"
- "yamllint"
Expand Down Expand Up @@ -126,7 +137,7 @@ jobs:
context: "./"
push: false
load: true
tags: "${{ env.PLUGIN_NAME }}/nautobot:${{ matrix.nautobot-version }}-py${{ matrix.python-version }}"
tags: "${{ env.APP_NAME }}/nautobot:${{ matrix.nautobot-version }}-py${{ matrix.python-version }}"
file: "./development/Dockerfile"
cache-from: "type=gha,scope=${{ matrix.nautobot-version }}-py${{ matrix.python-version }}"
cache-to: "type=gha,scope=${{ matrix.nautobot-version }}-py${{ matrix.python-version }}"
Expand All @@ -140,7 +151,7 @@ jobs:
check-migrations:
needs:
- "bandit"
- "pydocstyle"
- "ruff"
- "flake8"
- "poetry"
- "yamllint"
Expand Down Expand Up @@ -169,7 +180,7 @@ jobs:
context: "./"
push: false
load: true
tags: "${{ env.PLUGIN_NAME }}/nautobot:${{ matrix.nautobot-version }}-py${{ matrix.python-version }}"
tags: "${{ env.APP_NAME }}/nautobot:${{ matrix.nautobot-version }}-py${{ matrix.python-version }}"
file: "./development/Dockerfile"
cache-from: "type=gha,scope=${{ matrix.nautobot-version }}-py${{ matrix.python-version }}"
cache-to: "type=gha,scope=${{ matrix.nautobot-version }}-py${{ matrix.python-version }}"
Expand Down Expand Up @@ -216,7 +227,7 @@ jobs:
context: "./"
push: false
load: true
tags: "${{ env.PLUGIN_NAME }}/nautobot:${{ matrix.nautobot-version }}-py${{ matrix.python-version }}"
tags: "${{ env.APP_NAME }}/nautobot:${{ matrix.nautobot-version }}-py${{ matrix.python-version }}"
file: "./development/Dockerfile"
cache-from: "type=gha,scope=${{ matrix.nautobot-version }}-py${{ matrix.python-version }}"
cache-to: "type=gha,scope=${{ matrix.nautobot-version }}-py${{ matrix.python-version }}"
Expand All @@ -230,12 +241,30 @@ jobs:
if: "matrix.db-backend == 'mysql'"
- name: "Run Tests"
run: "poetry run invoke unittest"
changelog:
if: |
contains(fromJson('["develop","ltm-1.6"]'), github.base_ref) &&
(github.head_ref != 'main')
runs-on: "ubuntu-22.04"
steps:
- name: "Check out repository code"
uses: "actions/checkout@v4"
with:
fetch-depth: "0"
- name: "Setup environment"
uses: "networktocode/gh-action-setup-poetry-environment@v4"
- name: "Check for changelog entry"
run: |
git fetch --no-tags origin +refs/heads/${{ github.base_ref }}:refs/remotes/origin/${{ github.base_ref }}
poetry run towncrier check --compare-with origin/${{ github.base_ref }}
publish_gh:
needs:
- "unittest"
name: "Publish to GitHub"
runs-on: "ubuntu-22.04"
if: "startsWith(github.ref, 'refs/tags/v')"
env:
INVOKE_NAUTOBOT_GOLDEN_CONFIG_LOCAL: "True"
steps:
- name: "Check out repository code"
uses: "actions/checkout@v4"
Expand Down Expand Up @@ -269,6 +298,8 @@ jobs:
name: "Push Package to PyPI"
runs-on: "ubuntu-22.04"
if: "startsWith(github.ref, 'refs/tags/v')"
env:
INVOKE_NAUTOBOT_GOLDEN_CONFIG_LOCAL: "True"
steps:
- name: "Check out repository code"
uses: "actions/checkout@v4"
Expand Down
118 changes: 0 additions & 118 deletions .github/workflows/rebake.yml

This file was deleted.

2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Apache Software License 2.0

Copyright (c) 2023, Network to Code, LLC
Copyright (c) 2024, Network to Code, LLC

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand Down
38 changes: 6 additions & 32 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
# Nautobot Golden Config

<p align="center">
<img src="https://raw.githubusercontent.com/nautobot/nautobot-app-golden-config/develop/docs/images/icon-NautobotGoldenConfig.png" class="logo" height="200px">
<img src="https://raw.githubusercontent.com/nautobot/nautobot-app-golden-config/develop/docs/images/icon-nautobot-golden-config.png" class="logo" height="200px">
<br>
<a href="https://github.com/nautobot/nautobot-app-golden-config/actions"><img src="https://github.com/nautobot/nautobot-app-golden-config/actions/workflows/ci.yml/badge.svg?branch=main"></a>
<a href="https://docs.nautobot.com/projects/golden-config/en/latest/"><img src="https://readthedocs.org/projects/nautobot-plugin-golden-config/badge/"></a>
<a href="https://docs.nautobot.com/projects/golden-config/en/latest"><img src="https://readthedocs.org/projects/nautobot-app-golden-config/badge/"></a>
<a href="https://pypi.org/project/nautobot-golden-config/"><img src="https://img.shields.io/pypi/v/nautobot-golden-config"></a>
<a href="https://pypi.org/project/nautobot-golden-config/"><img src="https://img.shields.io/pypi/dm/nautobot-golden-config"></a>
<br>
Expand All @@ -20,37 +20,11 @@ The Golden Config App is a Nautobot App that provides a NetDevOps approach to go

### Key Use Cases

This app enable six (6) key use cases.
> Developer Note: Place the files in the `docs/images/` folder and link them using only full URLs from GitHub, for example: `![Overview](https://raw.githubusercontent.com/nautobot/nautobot-app-golden-config/develop/docs/images/app-overview.png)`. This absolute static linking is required to ensure the README renders properly in GitHub, the docs site, and any other external sites like PyPI.
1. **Configuration Backups** - Is a Nornir process to connect to devices, optionally parse out lines/secrets, backup the configuration, and save to a Git repository.
2. **Intended Configuration** - Is a Nornir process to generate configuration based on a Git repo of Jinja files to combine with a GraphQL generated data and a Git repo to store the intended configuration.
3. **Source of Truth Aggregation** - Is a GraphQL query per device that creates a data structure used in the generation of configuration.
4. **Configuration Compliance** - Is a process to run comparison of the actual (via backups) and intended (via Jinja file creation) CLI configurations upon saving the actual and intended configuration. This is started by either a Nornir process for cli-like configurations or calling the API for json-like configurations
5. **Configuration Remediation** - Is a process of generating a partial device configuration that would get a configuration feature into a compliant state.
6. **Configuration Deployment** - Is a process to generate a device configuration and push it to the network device. It supports compliance features, remediation engine and manual definitions.
More screenshots can be found in the [Using the App](https://docs.nautobot.com/projects/golden-config/en/latest/user/app_use_cases/) page in the documentation. Here's a quick overview of some of the app's added functionality:

> Notice: **Configuration Postprocessing** - (beta feature) This process renders a valid configuration artifact from an intended configuration, that can be pushed to devices. The current implementation renders this configuration; however, **it doesn't push it** to the target device.
> Notice: The operators of their own Nautobot instance are welcome to use any combination of these features. Though the appearance may seem like they are tightly coupled, this isn't actually the case. For example, one can obtain backup configurations from their current RANCID/Oxidized process and simply provide a Git Repo of the location of the backup configurations, and the compliance process would work the same way. Also, another user may only want to generate configurations, but not want to use other features, which is perfectly fine to do so.
## Screenshots

There are many features and capabilities the app provides into the Nautobot ecosystem. The following screenshots are intended to provide a quick visual overview of some of these features.

The golden configuration is driven by jobs that run a series of tasks and the result is captured in this overview.

![Overview](https://raw.githubusercontent.com/nautobot/nautobot-app-golden-config/develop/docs/images/ss_golden-overview.png)

The compliance report provides a high-level overview on the compliance of your network.
![Compliance Report](https://raw.githubusercontent.com/nautobot/nautobot-app-golden-config/develop/docs/images/ss_compliance-report.png)

The compliance overview will provide a per device and feature overview on the compliance of your network devices.
![Compliance Overview](https://raw.githubusercontent.com/nautobot/nautobot-app-golden-config/develop/docs/images/ss_compliance-overview.png)

Drilling into a specific device and feature, you can get an immediate detailed understanding of your device.
![Compliance Device](https://raw.githubusercontent.com/nautobot/nautobot-app-golden-config/develop/docs/images/ss_compliance-device.png)

![Compliance Rule](https://raw.githubusercontent.com/nautobot/nautobot-app-golden-config/develop/docs/images/ss_compliance-rule.png)
![](https://raw.githubusercontent.com/nautobot/nautobot-app-golden-config/develop/docs/images/placeholder.png)

## Try it out!

Expand All @@ -70,7 +44,7 @@ Full web-based HTML documentation for this app can be found over on the [Nautobo

### Contributing to the Docs

You can find all the Markdown source for the App documentation under the [docs](https://github.com/nautobot/nautobot-app-golden-config/tree/develop/docs) folder in this repository. For simple edits, a Markdown capable editor is sufficient - clone the repository and edit away.
You can find all the Markdown source for the App documentation under the [`docs`](https://github.com/nautobot/nautobot-app-golden-config/tree/develop/docs) folder in this repository. For simple edits, a Markdown capable editor is sufficient: clone the repository and edit away.

If you need to view the fully generated documentation site, you can build it with [mkdocs](https://www.mkdocs.org/). A container hosting the docs will be started using the invoke commands (details in the [Development Environment Guide](https://docs.nautobot.com/projects/golden-config/en/latest/dev/dev_environment/#docker-development-environment)) on [http://localhost:8001](http://localhost:8001). As your changes are saved, the live docs will be automatically reloaded.

Expand Down
1 change: 1 addition & 0 deletions changes/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
!.gitignore
4 changes: 2 additions & 2 deletions development/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,8 @@ RUN pip show nautobot | grep "^Version: " | sed -e 's/Version: /nautobot==/' > c
#
# We can't use the entire freeze as it takes forever to resolve with rigidly fixed non-direct dependencies,
# especially those that are only direct to Nautobot but the container included versions slightly mismatch
RUN poetry export -f requirements.txt --without-hashes --output poetry_freeze_base.txt
RUN poetry export -f requirements.txt --with dev --without-hashes --output poetry_freeze_all.txt
RUN poetry export -f requirements.txt --without-hashes --extras all --output poetry_freeze_base.txt
RUN poetry export -f requirements.txt --without-hashes --extras all --with dev --output poetry_freeze_all.txt
RUN sort poetry_freeze_base.txt poetry_freeze_all.txt | uniq -u > poetry_freeze_dev.txt

# Install all local project as editable, constrained on Nautobot version, to get any additional
Expand Down
6 changes: 4 additions & 2 deletions development/docker-compose.base.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@ services:
- "-c" # this is to evaluate the $NAUTOBOT_LOG_LEVEL from the env
- "nautobot-server celery worker -l $$NAUTOBOT_LOG_LEVEL --events" ## $$ because of docker-compose
depends_on:
- "nautobot"
nautobot:
condition: "service_healthy"
healthcheck:
interval: "30s"
timeout: "10s"
Expand All @@ -44,7 +45,8 @@ services:
- "-c" # this is to evaluate the $NAUTOBOT_LOG_LEVEL from the env
- "nautobot-server celery beat -l $$NAUTOBOT_LOG_LEVEL" ## $$ because of docker-compose
depends_on:
- "nautobot"
nautobot:
condition: "service_healthy"
healthcheck:
disable: true
<<: *nautobot-base
12 changes: 12 additions & 0 deletions development/docker-compose.dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@ services:
# - "../../nautobot/nautobot:/usr/local/lib/python3.11/site-packages/nautobot"

healthcheck:
interval: "30s"
timeout: "10s"
start_period: "60s"
retries: 3
test: ["CMD", "true"] # Due to layering, disable: true won't work. Instead, change the test
docs:
entrypoint: "mkdocs serve -v -a 0.0.0.0:8080"
Expand Down Expand Up @@ -48,6 +52,14 @@ services:
# - "../../nautobot/nautobot:/usr/local/lib/python3.11/site-packages/nautobot"
healthcheck:
test: ["CMD", "true"] # Due to layering, disable: true won't work. Instead, change the test
beat:
entrypoint:
- "sh"
- "-c" # this is to evaluate the $NAUTOBOT_LOG_LEVEL from the env
- "watchmedo auto-restart --directory './' --pattern '*.py' --recursive -- nautobot-server celery beat -l $$NAUTOBOT_LOG_LEVEL" ## $$ because of docker-compose
volumes:
- "./nautobot_config.py:/opt/nautobot/nautobot_config.py"
- "../:/source"
# To expose postgres or redis to the host uncomment the following
# postgres:
# ports:
Expand Down
Loading

0 comments on commit a549059

Please sign in to comment.