diff --git a/.cookiecutter.json b/.cookiecutter.json index ea65bfeb..d8d0ee46 100644 --- a/.cookiecutter.json +++ b/.cookiecutter.json @@ -10,12 +10,10 @@ "project_slug": "nautobot-plugin-golden-config", "repo_url": "https://github.com/nautobot/nautobot-plugin-golden-config", "base_url": "golden-config", - "min_nautobot_version": "1.4.0", - "max_nautobot_version": "1.9999", - "nautobot_version": "latest", + "min_nautobot_version": "2.0.0", + "max_nautobot_version": "2.9999", "camel_name": "NautobotGoldenConfig", "project_short_description": "A plugin for configuration on nautobot", - "version": "1.0.0", "model_class_name": "None", "open_source_license": "Apache-2.0", "docs_base_url": "https://docs.nautobot.com", @@ -27,7 +25,11 @@ "cookie_dir": "", "branch_prefix": "drift-manager", "pull_request_strategy": "create", - "post_actions": [] + "post_actions": [ + "black" + ], + "draft": true, + "baked_commit_ref": "c6963e367d835faf66a9f4ac63267b6ce5811577" } } } diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md index cbb194ae..8d0594cb 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.md +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -4,8 +4,8 @@ about: Report a reproducible bug in the current release of nautobot-golden-confi --- ### Environment -* Python version: -* Nautobot version: +* Python version: +* Nautobot version: * nautobot-golden-config version: diff --git a/.github/ISSUE_TEMPLATE/feature_request.md b/.github/ISSUE_TEMPLATE/feature_request.md index a8d54617..3506acde 100644 --- a/.github/ISSUE_TEMPLATE/feature_request.md +++ b/.github/ISSUE_TEMPLATE/feature_request.md @@ -5,7 +5,7 @@ about: Propose a new feature or enhancement --- ### Environment -* Nautobot version: +* Nautobot version: * nautobot-golden-config version: -## Change Notes +# Closes: # -## Justification +## What's Changed + + + +## To Do + + +- [ ] Explanation of Change(s) +- [ ] Attached Screenshots, Payload Example +- [ ] Unit, Integration Tests +- [ ] Documentation Updates (when adding/changing features) +- [ ] Example Plugin Updates (when adding/changing features) +- [ ] Outline Remaining Work, Constraints from Design diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 632b3dc2..68e3d45e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -8,6 +8,7 @@ on: # yamllint disable-line rule:truthy rule:comments branches: - "main" - "develop" + - "ltm-1.6" tags: - "v*" pull_request: ~ @@ -17,56 +18,67 @@ env: jobs: black: - runs-on: "ubuntu-20.04" + runs-on: "ubuntu-22.04" env: INVOKE_NAUTOBOT_GOLDEN_CONFIG_LOCAL: "True" steps: - name: "Check out repository code" - uses: "actions/checkout@v3" + uses: "actions/checkout@v4" - name: "Setup environment" uses: "networktocode/gh-action-setup-poetry-environment@v4" - name: "Linting: black" run: "poetry run invoke black" bandit: - runs-on: "ubuntu-20.04" + runs-on: "ubuntu-22.04" env: INVOKE_NAUTOBOT_GOLDEN_CONFIG_LOCAL: "True" steps: - name: "Check out repository code" - uses: "actions/checkout@v3" + uses: "actions/checkout@v4" - name: "Setup environment" uses: "networktocode/gh-action-setup-poetry-environment@v4" - name: "Linting: bandit" run: "poetry run invoke bandit" pydocstyle: - runs-on: "ubuntu-20.04" + runs-on: "ubuntu-22.04" env: INVOKE_NAUTOBOT_GOLDEN_CONFIG_LOCAL: "True" steps: - name: "Check out repository code" - uses: "actions/checkout@v3" + uses: "actions/checkout@v4" - name: "Setup environment" uses: "networktocode/gh-action-setup-poetry-environment@v4" - name: "Linting: pydocstyle" run: "poetry run invoke pydocstyle" flake8: - runs-on: "ubuntu-20.04" + runs-on: "ubuntu-22.04" env: INVOKE_NAUTOBOT_GOLDEN_CONFIG_LOCAL: "True" steps: - name: "Check out repository code" - uses: "actions/checkout@v3" + uses: "actions/checkout@v4" - name: "Setup environment" uses: "networktocode/gh-action-setup-poetry-environment@v4" - name: "Linting: flake8" run: "poetry run invoke flake8" + poetry: + 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: "Checking: poetry lock file" + run: "poetry run invoke lock --check" yamllint: - runs-on: "ubuntu-20.04" + runs-on: "ubuntu-22.04" env: INVOKE_NAUTOBOT_GOLDEN_CONFIG_LOCAL: "True" steps: - name: "Check out repository code" - uses: "actions/checkout@v3" + uses: "actions/checkout@v4" - name: "Setup environment" uses: "networktocode/gh-action-setup-poetry-environment@v4" - name: "Linting: yamllint" @@ -76,9 +88,10 @@ jobs: - "bandit" - "pydocstyle" - "flake8" + - "poetry" - "yamllint" - "black" - runs-on: "ubuntu-20.04" + runs-on: "ubuntu-22.04" strategy: fail-fast: true matrix: @@ -89,14 +102,14 @@ jobs: INVOKE_NAUTOBOT_GOLDEN_CONFIG_NAUTOBOT_VER: "${{ matrix.nautobot-version }}" steps: - name: "Check out repository code" - uses: "actions/checkout@v3" + uses: "actions/checkout@v4" - name: "Setup environment" uses: "networktocode/gh-action-setup-poetry-environment@v4" - name: "Set up Docker Buildx" id: "buildx" - uses: "docker/setup-buildx-action@v1" + uses: "docker/setup-buildx-action@v3" - name: "Build" - uses: "docker/build-push-action@v2" + uses: "docker/build-push-action@v5" with: builder: "${{ steps.buildx.outputs.name }}" context: "./" @@ -113,42 +126,80 @@ jobs: run: "cp development/creds.example.env development/creds.env" - name: "Linting: pylint" run: "poetry run invoke pylint" + check-migrations: + needs: + - "bandit" + - "pydocstyle" + - "flake8" + - "poetry" + - "yamllint" + - "black" + runs-on: "ubuntu-22.04" + strategy: + fail-fast: true + matrix: + python-version: ["3.11"] + nautobot-version: ["2.0.0"] + env: + INVOKE_NAUTOBOT_GOLDEN_CONFIG_PYTHON_VER: "${{ matrix.python-version }}" + INVOKE_NAUTOBOT_GOLDEN_CONFIG_NAUTOBOT_VER: "${{ matrix.nautobot-version }}" + steps: + - name: "Check out repository code" + uses: "actions/checkout@v4" + - name: "Setup environment" + uses: "networktocode/gh-action-setup-poetry-environment@v4" + - name: "Set up Docker Buildx" + id: "buildx" + uses: "docker/setup-buildx-action@v3" + - name: "Build" + uses: "docker/build-push-action@v5" + with: + builder: "${{ steps.buildx.outputs.name }}" + context: "./" + push: false + load: true + tags: "${{ env.PLUGIN_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 }}" + build-args: | + NAUTOBOT_VER=${{ matrix.nautobot-version }} + PYTHON_VER=${{ matrix.python-version }} + - name: "Copy credentials" + run: "cp development/creds.example.env development/creds.env" + - name: "Checking: migrations" + run: "poetry run invoke check-migrations" unittest: needs: - "pylint" + - "check-migrations" strategy: fail-fast: true matrix: - python-version: ["3.8", "3.9", "3.10", "3.11"] + python-version: ["3.8", "3.11"] db-backend: ["postgresql"] nautobot-version: ["stable"] - # The include is a method to limit the amount of jobs ran. This essentially - # means that in addition to standard postgres and stable, also the lowest - # supported version and with mysql include: - python-version: "3.11" db-backend: "postgresql" nautobot-version: "2.0.0" - python-version: "3.11" - db-backend: "mysql" - nautobot-version: "2.0.0" - - python-version: "3.8" db-backend: "mysql" nautobot-version: "stable" - runs-on: "ubuntu-20.04" + runs-on: "ubuntu-22.04" env: INVOKE_NAUTOBOT_GOLDEN_CONFIG_PYTHON_VER: "${{ matrix.python-version }}" INVOKE_NAUTOBOT_GOLDEN_CONFIG_NAUTOBOT_VER: "${{ matrix.nautobot-version }}" steps: - name: "Check out repository code" - uses: "actions/checkout@v3" + uses: "actions/checkout@v4" - name: "Setup environment" uses: "networktocode/gh-action-setup-poetry-environment@v4" - name: "Set up Docker Buildx" id: "buildx" - uses: "docker/setup-buildx-action@v1" + uses: "docker/setup-buildx-action@v3" - name: "Build" - uses: "docker/build-push-action@v2" + uses: "docker/build-push-action@v5" with: builder: "${{ steps.buildx.outputs.name }}" context: "./" @@ -172,13 +223,13 @@ jobs: needs: - "unittest" name: "Publish to GitHub" - runs-on: "ubuntu-20.04" + runs-on: "ubuntu-22.04" if: "startsWith(github.ref, 'refs/tags/v')" steps: - name: "Check out repository code" - uses: "actions/checkout@v3" + uses: "actions/checkout@v4" - name: "Set up Python" - uses: "actions/setup-python@v2" + uses: "actions/setup-python@v4" with: python-version: "3.11" - name: "Install Python Packages" @@ -201,13 +252,13 @@ jobs: needs: - "unittest" name: "Push Package to PyPI" - runs-on: "ubuntu-20.04" + runs-on: "ubuntu-22.04" if: "startsWith(github.ref, 'refs/tags/v')" steps: - name: "Check out repository code" - uses: "actions/checkout@v3" + uses: "actions/checkout@v4" - name: "Set up Python" - uses: "actions/setup-python@v2" + uses: "actions/setup-python@v4" with: python-version: "3.11" - name: "Install Python Packages" @@ -227,7 +278,7 @@ jobs: needs: - "publish_gh" - "publish_pypi" - runs-on: "ubuntu-20.04" + runs-on: "ubuntu-22.04" env: SLACK_WEBHOOK_URL: "${{ secrets.SLACK_WEBHOOK_URL }}" SLACK_MESSAGE: >- @@ -240,7 +291,7 @@ jobs: # ENVs cannot be used directly in job.if. This is a workaround to check # if SLACK_WEBHOOK_URL is present. if: "env.SLACK_WEBHOOK_URL != ''" - uses: "slackapi/slack-github-action@v1.17.0" + uses: "slackapi/slack-github-action@v1" with: payload: | { diff --git a/.github/workflows/rebake.yaml b/.github/workflows/rebake.yaml deleted file mode 100644 index 6b91c3fd..00000000 --- a/.github/workflows/rebake.yaml +++ /dev/null @@ -1,34 +0,0 @@ ---- -name: "Rebake Cookie" -on: # yamllint disable-line rule:truthy - schedule: - # Every Saturday at 5:00 am UTC - - cron: "0 5 * * 6" - workflow_dispatch: - inputs: - template-ref: - description: "The branch or tag to use for the template, using the value from .cookiecutter.json when empty" - default: "" -jobs: - rebake: - runs-on: "ubuntu-22.04" - permissions: - actions: "write" - contents: "write" - packages: "read" - pull-requests: "write" - container: "ghcr.io/nautobot/cookiecutter-nautobot-app-drift-manager/prod:latest" - env: - GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}" - steps: - - name: "Configure" - id: "config" - run: | - export REBAKE_ARGS='--push' - if [[ ${{ github.event_name }} == 'workflow_dispatch' ]]; then - export REBAKE_ARGS="$REBAKE_ARGS --template-ref='${{ github.event.inputs.template-ref }}'" - fi - echo "rebake-args='$REBAKE_ARGS'" >> $GITHUB_OUTPUT - - name: "Rebake" - run: | - python -m ntc_cookie_drift_manager rebake ${{ steps.config.outputs.rebake-args }} '${{ github.repositoryUrl }}' diff --git a/.github/workflows/rebake.yml b/.github/workflows/rebake.yml new file mode 100644 index 00000000..b4688842 --- /dev/null +++ b/.github/workflows/rebake.yml @@ -0,0 +1,118 @@ +--- +name: "Rebake Cookie" +on: # yamllint disable-line rule:truthy + workflow_call: + inputs: + cookie: + description: "The cookie to rebake" + type: "string" + default: "" + draft: + description: "Whether to create the pull request as a draft" + type: "string" + default: "" + pull-request: + description: "The pull request strategy" + type: "string" + default: "" + template: + description: "The template repository URL" + type: "string" + default: "" + template-dir: + description: "The directory within the template repository to use as the template" + type: "string" + default: "" + template-ref: + description: "The branch or tag to use for the template" + type: "string" + default: "" + drift-manager-tag: + description: "The drift manager Docker image tag to use" + type: "string" + default: "prod" + workflow_dispatch: + inputs: + cookie: + description: "The cookie to rebake" + type: "string" + default: "" + draft: + description: "Whether to create the pull request as a draft" + type: "string" + default: "" + pull-request: + description: "The pull request strategy" + type: "string" + default: "" + template: + description: "The template repository URL" + type: "string" + default: "" + template-dir: + description: "The directory within the template repository to use as the template" + type: "string" + default: "" + template-ref: + description: "The branch or tag to use for the template" + type: "string" + default: "" + drift-manager-tag: + description: "The drift manager Docker image tag to use" + type: "string" + default: "prod" +jobs: + rebake: + runs-on: "ubuntu-22.04" + permissions: + actions: "write" + contents: "write" + packages: "read" + pull-requests: "write" + container: "ghcr.io/nautobot/cookiecutter-nautobot-app-drift-manager/prod:${{ github.event.inputs.drift-manager-tag }}" + env: + GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}" + steps: + - name: "Configure Rebake Arguments" + id: "config" + shell: "bash" + run: | + ARGS='--push' + + if [[ '${{ github.event.inputs.draft }}' == 'true' ]]; then + ARGS="$ARGS --draft" + elif [[ '${{ github.event.inputs.draft }}' == 'false' ]]; then + ARGS="$ARGS --no-draft" + elif [[ '${{ github.event.inputs.draft }}' == '' ]]; then + echo "Using repo default value for --draft" + else + echo "ERROR: Invalid value for draft: '${{ github.event.inputs.draft }}'" + exit 1 + fi + + if [[ '${{ github.event.inputs.pull-request }}' != '' ]]; then + ARGS="$ARGS --pull-request='${{ github.event.inputs.pull-request }}'" + fi + + if [[ '${{ github.event.inputs.template }}' != '' ]]; then + ARGS="$ARGS --template='${{ github.event.inputs.template }}'" + fi + + if [[ '${{ github.event.inputs.template-dir }}' != '' ]]; then + ARGS="$ARGS --template-dir='${{ github.event.inputs.template-dir }}'" + fi + + if [[ '${{ github.event.inputs.template-ref }}' != '' ]]; then + ARGS="$ARGS --template-ref='${{ github.event.inputs.template-ref }}'" + fi + + if [[ '${{ github.event.inputs.cookie }}' == '' ]]; then + ARGS="$ARGS '${{ github.repositoryUrl }}'" + else + ARGS="$ARGS '${{ github.event.inputs.cookie }}'" + fi + + echo "args=$ARGS" >> $GITHUB_OUTPUT + - name: "Rebake" + run: | + python -m ntc_cookie_drift_manager rebake ${{ steps.config.outputs.args }} diff --git a/.gitignore b/.gitignore index 9e81c36c..c812ea13 100644 --- a/.gitignore +++ b/.gitignore @@ -310,3 +310,4 @@ invoke.yml public /compose.yaml /dump.sql +/nautobot_golden_config/static/nautobot_golden_config/docs diff --git a/.readthedocs.yaml b/.readthedocs.yaml index a6334706..1aa8ad22 100644 --- a/.readthedocs.yaml +++ b/.readthedocs.yaml @@ -14,7 +14,7 @@ build: mkdocs: configuration: "mkdocs.yml" - # fail_on_warning: true + fail_on_warning: true # Use our docs/requirements.txt during installation. python: diff --git a/development/Dockerfile b/development/Dockerfile index e109a262..a7a0870d 100644 --- a/development/Dockerfile +++ b/development/Dockerfile @@ -19,20 +19,21 @@ FROM ghcr.io/nautobot/nautobot-dev:${NAUTOBOT_VER}-py${PYTHON_VER} ARG NAUTOBOT_ROOT=/opt/nautobot ENV prometheus_multiproc_dir=/prom_cache -ENV NAUTOBOT_ROOT ${NAUTOBOT_ROOT} +ENV NAUTOBOT_ROOT=${NAUTOBOT_ROOT} +ENV INVOKE_NAUTOBOT_GOLDEN_CONFIG_LOCAL=true # Install Poetry manually via its installer script; # We might be using an older version of Nautobot that includes an older version of Poetry # and CI and local development may have a newer version of Poetry # Since this is only used for development and we don't ship this container, pinning Poetry back is not expressly necessary # We also don't need virtual environments in container -RUN curl -sSL https://install.python-poetry.org | python3 - && \ +RUN which poetry || curl -sSL https://install.python-poetry.org | python3 - && \ poetry config virtualenvs.create false # !!! USE CAUTION WHEN MODIFYING LINES ABOVE # ------------------------------------------------------------------------------------- # App-specifc system build/test dependencies. -# +# # Example: LDAP requires `libldap2-dev` to be apt-installed before the Python package. # ------------------------------------------------------------------------------------- # --> Start safe to modify section @@ -68,11 +69,13 @@ RUN sort poetry_freeze_base.txt poetry_freeze_all.txt | uniq -u > poetry_freeze_ # Install all local project as editable, constrained on Nautobot version, to get any additional # direct dependencies of the app -RUN pip install -c constraints.txt -e . +RUN --mount=type=cache,target="/root/.cache/pip",sharing=locked \ + pip install -c constraints.txt -e .[all] # Install any dev dependencies frozen from Poetry # Can be improved in Poetry 1.2 which allows `poetry install --only dev` -RUN pip install -c constraints.txt -r poetry_freeze_dev.txt +RUN --mount=type=cache,target="/root/.cache/pip",sharing=locked \ + pip install -c constraints.txt -r poetry_freeze_dev.txt COPY development/nautobot_config.py ${NAUTOBOT_ROOT}/nautobot_config.py # !!! USE CAUTION WHEN MODIFYING LINES ABOVE diff --git a/development/docker-compose.base.yml b/development/docker-compose.base.yml index 6a0a4c72..3dda2b07 100644 --- a/development/docker-compose.base.yml +++ b/development/docker-compose.base.yml @@ -38,3 +38,13 @@ services: retries: 3 test: ["CMD", "bash", "-c", "nautobot-server celery inspect ping --destination celery@$$HOSTNAME"] ## $$ because of docker-compose <<: *nautobot-base + beat: + entrypoint: + - "sh" + - "-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" + healthcheck: + disable: true + <<: *nautobot-base diff --git a/docs/admin/admin_uninstall.md b/docs/admin/admin_uninstall.md deleted file mode 100644 index 2bc048c7..00000000 --- a/docs/admin/admin_uninstall.md +++ /dev/null @@ -1,9 +0,0 @@ -# Uninstall the App from Nautobot - -## Uninstall Guide - -Remove the configuration you added in `nautobot_config.py` from `PLUGINS` & `PLUGINS_CONFIG`. - -## Database Cleanup - -Drop all tables from the plugin: `nautobot_plugin_goldenconfig*`. diff --git a/docs/admin/compatibility_matrix.md b/docs/admin/compatibility_matrix.md index 8a3e2e55..e24d35fd 100644 --- a/docs/admin/compatibility_matrix.md +++ b/docs/admin/compatibility_matrix.md @@ -17,4 +17,4 @@ While that last supported version will not be strictly enforced via the `max_ver | 1.4.X | 1.5.3 | 1.5.99 [Official] | | 1.5.X | 1.6.1 | 1.6.99 [Official] | | 1.6.X | 1.6.1 | 1.6.99 [Official] | -| 2.0.x | 2.0.0 | TBD | +| 2.0.x | 2.0.0 | 2.0.99 | diff --git a/docs/admin/admin_install.md b/docs/admin/install.md similarity index 94% rename from docs/admin/admin_install.md rename to docs/admin/install.md index df2653d7..0e9f4bf0 100644 --- a/docs/admin/admin_install.md +++ b/docs/admin/install.md @@ -1,13 +1,16 @@ # Installing the App in Nautobot +Here you will find detailed instructions on how to **install** and **configure** the App within your Nautobot environment. + ## Prerequisites - The plugin relies on [`nautobot_plugin_nornir`](https://pypi.org/project/nautobot-plugin-nornir/) to be installed and both plugins to be enabled in your configuration settings. -- The plugin is compatible with Nautobot 1.4.0 and higher. +- The latest version of this plugin is compatible with Nautobot 2.0.0 and higher, see [this dedicated page](compatibility_matrix.md) for a full compatibility matrix and the deprecation policy. - Databases supported: PostgreSQL, MySQL -!!! note - Please check the [dedicated page](compatibility_matrix.md) for a full compatibility matrix and the deprecation policy. +### Access Requirements + +There are no access requirements from external systems to this plugin. ## Install Guide @@ -71,13 +74,13 @@ PLUGINS_CONFIG = { } ``` -Once the Nautobot configuration is updated, run the Post Upgrade command (`nautobot-server post_upgrade`) to run migrations and clear any cache. +Once the Nautobot configuration is updated, run the Post Upgrade command (`nautobot-server post_upgrade`) to run migrations and clear any cache: ```shell nautobot-server post_upgrade ``` -Then restart the Nautobot services which may include: +Then restart (if necessary) the Nautobot services which may include: - Nautobot - Nautobot Workers @@ -89,7 +92,7 @@ sudo systemctl restart nautobot nautobot-worker nautobot-scheduler ## App Configuration -The plugin behavior can be controlled with the following list of settings. +The plugin behavior can be controlled with the following list of settings: !!! note The `enable_backup`, `enable_compliance`, `enable_intended`, `enable_sotagg`, `enable_plan`, `enable_deploy`, and `enable_postprocessing` will toggle inclusion of the entire component. @@ -153,4 +156,4 @@ PLUGINS_CONFIG = { } ``` -The format for defining these methods is via the dotted string format that will be imported by Django. For example, the Netmiko Cisco IOS dispatcher is defined as `nornir_nautobot.plugins.tasks.dispatcher.cisco_ios.NetmikoCiscoIos`. You also must hand any installation of the packaging and assurance that the value you provide is importable in the environment you run it on. \ No newline at end of file +The format for defining these methods is via the dotted string format that will be imported by Django. For example, the Netmiko Cisco IOS dispatcher is defined as `nornir_nautobot.plugins.tasks.dispatcher.cisco_ios.NetmikoCiscoIos`. You also must hand any installation of the packaging and assurance that the value you provide is importable in the environment you run it on. diff --git a/docs/admin/migrating_to_v2.md b/docs/admin/migrating_to_v2.md index 5aa4baaa..e1452cfb 100644 --- a/docs/admin/migrating_to_v2.md +++ b/docs/admin/migrating_to_v2.md @@ -41,14 +41,14 @@ If previously you have leveraged the `dispatcher_mapping` to use your preferred ## Dynamic Group !!! tip - You can safely skip this section if your Dynamic Groups did not use slugs or one of the removed models or you Dynamic Groups are currently in the required state. + You can safely skip this section if your Dynamic Groups was not using slugs/Site/Region/DeviceRole or your Dynamic Groups are currently in the required state. In an effort to guide you along, you are highly encouraged to leverage the `nautobot-server audit_dynamic_groups` as [documented](https://docs.nautobot.com/projects/core/en/v2.0.0/user-guide/administration/tools/nautobot-server/#audit_dynamic_groups). You will know you have completed this step, when the scope of devices in your Dynamic Group match your expectations. ## GraphQL !!! tip - You can safely skip this section if your GraphQL did not use slugs or one of the removed models or your saved GraphQL currently renders to the appropriate state. + You can safely skip this section if your GraphQL Query was not using slugs/Site/Region/DeviceRole or your saved GraphQL Query currently renders to the appropriate state. As mentioned, any reference to slug or to one of the removed models will need to be updated to reflect Nautobot 2.0 standards, in this example we will review what would need to change. @@ -145,9 +145,8 @@ _Path for backup and intended_ _Path for templates_ ```jinja -{{obj.platform.slug}}.j2 -{{obj.platform.network_driver}}.j2 <---- old way of doing it -{{obj.location.name|slugify}}/{{obj.name}} <---- new way of doing it +{{obj.platform.slug}}.j2 <---- old way of doing it +{{obj.platform.network_driver}}.j2 <---- new way of doing it ``` ## Custom Dispatcher @@ -190,13 +189,13 @@ PLUGINS_CONFIG = { } ``` -You can also see information within the [custom dispatcher docs](../admin/admin_install.md#custom-dispatcher). +The [custom dispatcher docs](../admin/install.md#custom-dispatcher) will provide further clarification if needed. ## Secrets !!! tip - You can safely skip this section if you have already been using Nautobot Secrets vs Git Repository Token. + You can safely skip this section if you have already been using Nautobot Secrets and not Git Repository Token. Nautobot initially had the ability to store some secrets, this was deprecated when [Secrets framework](https://docs.nautobot.com/projects/core/en/stable/user-guide/platform-functionality/secret/) was added in Nautobot 1.2. The feature to directly store Secrets in the database has been removed in 2.0. -The documentation has been updated in docs covering [secret groups](../user/app_use_cases.md#create-secret-groups). \ No newline at end of file +The documentation has been updated in docs covering [secret groups](../user/app_use_cases.md#create-secret-groups). diff --git a/docs/admin/release_notes/version_1.6.md b/docs/admin/release_notes/version_1.6.md index 1e047824..259d890a 100755 --- a/docs/admin/release_notes/version_1.6.md +++ b/docs/admin/release_notes/version_1.6.md @@ -5,6 +5,12 @@ - Add functionality to compliance result to provide a Remediation plan. - Supports Nautobot >=1.6.1,<2.0.0. +## v1.6.3 - 2023-10 + +### Fixed + +- [#668](https://github.com/nautobot/nautobot-plugin-golden-config/issue/668) - Removed unneeded lookup for GoldenConfigSetting + ## v1.6.2 - 2023-09 ### Fixed diff --git a/docs/admin/release_notes/version_2.0.md b/docs/admin/release_notes/version_2.0.md index b3f2da3d..85ab0852 100755 --- a/docs/admin/release_notes/version_2.0.md +++ b/docs/admin/release_notes/version_2.0.md @@ -11,6 +11,23 @@ !!! note Please see [migrating guide](../migrating_to_v2.md) for details on migration. + +## v2.0.1 - 2023-12 + +### Fixed + +- [#676](https://github.com/nautobot/nautobot-plugin-golden-config/pull/676) - Fixes docs for running config plan job in 2.0. +- [#680](https://github.com/nautobot/nautobot-plugin-golden-config/pull/680) - Resolve RTD build issue. +- [#684](https://github.com/nautobot/nautobot-plugin-golden-config/pull/684) - Fix repo sync not executing on any task failure. +- [#685](https://github.com/nautobot/nautobot-plugin-golden-config/pull/685) - Cherry-pick #669 - Removed unneeded lookup for GoldenConfigSetting. +- [#686](https://github.com/nautobot/nautobot-plugin-golden-config/pull/686) - Fix incorrect permissions. + + +### Changed + +- [#658](https://github.com/nautobot/nautobot-plugin-golden-config/pull/658) - Cookie updated by NetworkToCode Cookie Drift Manager Tool +- [#671](https://github.com/nautobot/nautobot-plugin-golden-config/pull/671) - Finish Documentation Updates from Drift Manager + ## v2.0.0 - 2023-09 ### Changed diff --git a/docs/admin/uninstall.md b/docs/admin/uninstall.md new file mode 100644 index 00000000..44cfc88a --- /dev/null +++ b/docs/admin/uninstall.md @@ -0,0 +1,15 @@ +# Uninstall the App from Nautobot + +Here you will find any steps necessary to cleanly remove the App from your Nautobot environment. + +## Database Cleanup + +Prior to removing the plugin from the `nautobot_config.py`, run the following command to roll back any migration specific to this plugin. + +```shell +nautobot-server migrate nautobot_golden_config zero +``` + +## Remove App configuration + +Remove the configuration you added in `nautobot_config.py` from `PLUGINS` & `PLUGINS_CONFIG`. diff --git a/docs/admin/admin_upgrade.md b/docs/admin/upgrade.md similarity index 72% rename from docs/admin/admin_upgrade.md rename to docs/admin/upgrade.md index 53109384..f4192592 100644 --- a/docs/admin/admin_upgrade.md +++ b/docs/admin/upgrade.md @@ -1,8 +1,10 @@ # Upgrading the App +Here you will find any steps necessary to upgrade the App in your Nautobot environment. + ## Upgrade Guide -When a new release comes out it may be necessary to run a migration of the database to account for any changes in the data models used by this plugin. Execute the command `nautobot-server migrate` from the Nautobot install nautobot/ directory after updating the package. +When a new release comes out it may be necessary to run a migration of the database to account for any changes in the data models used by this plugin. Execute the command `nautobot-server post-upgrade` within the runtime environment of your Nautobot installation after updating the `nautobot-golden-config` package via `pip`. ## v1.0.0 diff --git a/docs/assets/extra.css b/docs/assets/extra.css index 131cef77..dfe2e4b1 100644 --- a/docs/assets/extra.css +++ b/docs/assets/extra.css @@ -18,6 +18,15 @@ font-size: 0.7rem; } +/* +* The default max-width is 61rem which does not provide nearly enough space to present code examples or larger tables +*/ +.md-grid { + margin-left: auto; + margin-right: auto; + max-width: 95%; +} + .md-tabs__link { font-size: 0.8rem; } @@ -39,7 +48,7 @@ } img.logo { - height: 100px; + height: 200px; } img.copyright-logo { @@ -85,3 +94,68 @@ a.autorefs-external::after { a.autorefs-external:hover::after { background-color: var(--md-accent-fg-color); } + + +/* Customization for mkdocs-version-annotations */ +:root { + /* Icon for "version-added" admonition: Material Design Icons "plus-box-outline" */ + --md-admonition-icon--version-added: url('data:image/svg+xml;charset=utf-8,'); + /* Icon for "version-changed" admonition: Material Design Icons "delta" */ + --md-admonition-icon--version-changed: url('data:image/svg+xml;charset=utf-8,'); + /* Icon for "version-removed" admonition: Material Design Icons "minus-circle-outline" */ + --md-admonition-icon--version-removed: url('data:image/svg+xml;charset=utf-8,'); +} + +/* "version-added" admonition in green */ +.md-typeset .admonition.version-added, +.md-typeset details.version-added { + border-color: rgb(0, 200, 83); +} + +.md-typeset .version-added>.admonition-title, +.md-typeset .version-added>summary { + background-color: rgba(0, 200, 83, .1); +} + +.md-typeset .version-added>.admonition-title::before, +.md-typeset .version-added>summary::before { + background-color: rgb(0, 200, 83); + -webkit-mask-image: var(--md-admonition-icon--version-added); + mask-image: var(--md-admonition-icon--version-added); +} + +/* "version-changed" admonition in orange */ +.md-typeset .admonition.version-changed, +.md-typeset details.version-changed { + border-color: rgb(255, 145, 0); +} + +.md-typeset .version-changed>.admonition-title, +.md-typeset .version-changed>summary { + background-color: rgba(255, 145, 0, .1); +} + +.md-typeset .version-changed>.admonition-title::before, +.md-typeset .version-changed>summary::before { + background-color: rgb(255, 145, 0); + -webkit-mask-image: var(--md-admonition-icon--version-changed); + mask-image: var(--md-admonition-icon--version-changed); +} + +/* "version-removed" admonition in red */ +.md-typeset .admonition.version-removed, +.md-typeset details.version-removed { + border-color: rgb(255, 82, 82); +} + +.md-typeset .version-removed>.admonition-title, +.md-typeset .version-removed>summary { + background-color: rgba(255, 82, 82, .1); +} + +.md-typeset .version-removed>.admonition-title::before, +.md-typeset .version-removed>summary::before { + background-color: rgb(255, 82, 82); + -webkit-mask-image: var(--md-admonition-icon--version-removed); + mask-image: var(--md-admonition-icon--version-removed); +} diff --git a/docs/assets/overrides/partials/copyright.html b/docs/assets/overrides/partials/copyright.html index e0b77e5f..b92cf5e3 100644 --- a/docs/assets/overrides/partials/copyright.html +++ b/docs/assets/overrides/partials/copyright.html @@ -1,3 +1,4 @@ +