{% extends 'generic/object.html' %} {% load helpers %} {% block extra_controls %}
{% csrf_token %}
{% endblock %} {% block content %}

Git audit

Repository{{ object.url }}
Branch{{ object.branch }}
Enabled{% checkmark object.enabled %}
Access{% if object.token_encrypted %}HTTPS token for {{ object.username|default:"git" }}{% elif object.ssh_key_encrypted %}SSH deploy key{% else %}none (local or anonymous){% endif %}
Strict mode{% checkmark object.strict %}{% if object.strict %} nothing is deployed while the repository is unreachable{% endif %}
Email addresses{% checkmark object.include_email %}{% if not object.include_email %} authors as <username>@netbox{% endif %}
Last test{% if object.last_result %}{% if object.last_result.ok %}ok{% else %}failed{% endif %} {{ object.last_result.detail }}{% else %}—{% endif %}
{% include 'inc/panels/tags.html' %} {% include 'inc/panels/comments.html' %}

Setting it up

One repository per NetBox installation, one folder per Checkmk instance (instances/<instance>/hosts/<host>.yaml, tag and contact groups, revisions/<no>.yaml). Every revision becomes a commit; the author is the NetBox user who deployed. Nothing is pushed with --force, so a protected branch works. No secrets are written.

  • GitLab: project access token with role Developer and scope write_repository; user name: any non-empty value, e.g. oauth2. Commit link: https://gitlab.example.com/group/repo/-/commit/{sha}
  • GitHub: fine-grained token for this repository with "Contents: read and write"; user name: x-access-token. Commit link: https://github.com/org/repo/commit/{sha}
  • Gitea/Forgejo: access token with write:repository; user name: your login. Commit link: https://gitea.example.com/org/repo/commit/{sha}
  • Bitbucket: repository access token with "Repositories: write"; user name: x-token-auth.
  • Azure DevOps: PAT with "Code: read & write"; user name: any value.
  • Any server over SSH: a deploy key with write access, URL git@host:path/repo.git.

The rollback never depends on Git: it always runs from the revisions in the NetBox database.

Recent commits

{% for r, link in recent %}{% empty %}{% endfor %} {% for r in failing %}{% endfor %}
{{ r|linkify }}{% if link %}{{ r.git_commit|truncatechars:12 }}{% else %}{{ r.git_commit|truncatechars:12 }}{% endif %}
nothing pushed yet
{{ r|linkify }}not pushed yet: {{ r.git_error }}
{% include "netbox_checkmk_sync/inc/busy.html" %} {% endblock %}