mikrotik-netbox-dns-sync deployment

This commit is contained in:
bryanpedini committed 2026-11-20 20:47:02 +01:00
1 parent b5a6da16b5
commit 8d63279730
5 files changed
+77

No files matched your search

+27
View File
@@ -1 +1,28 @@
# mikrotik-netbox-dns-sync Deployment
NetBox to MikroTik static DNS sync: [source/mikrotik-netbox-dns-sync](https://git.bjphoster.com/source/mikrotik-netbox-dns-sync).
Runs the script every 5 minutes on the [cron image](https://git.bjphoster.com/docker/cron) (`bryanpedini/cron`), logging to the container output. Nothing is built: the crontab and a checkout of the source repo are bind mounted, and `python3` (plus `tzdata`) is installed with `apk` when the container starts.
## Usage
```sh
cp env.example .env
chmod 600 .env
$EDITOR .env
git clone https://git.bjphoster.com/source/mikrotik-netbox-dns-sync.git data/source
docker compose up -d
```
`crontab` must be owned by `0:0`, as crond requires.
Every `SYNC_*` variable in `.env` is passed to the script without the prefix (`SYNC_NETBOX_URL` becomes `NETBOX_URL`, and so on), except `SYNC_SOURCE`, the path of the source checkout. See the source README for every variable and for the NetBox and RouterOS permissions.
`env.example` ships with `SYNC_DRY_RUN=true`. Run one sync by hand and check the plan before setting it to `false` and running `docker compose up -d` again:
```sh
docker compose exec cron python3 /jobs/netbox_dns_sync.py
docker compose logs -f
```
## Update
```sh
git -C data/source pull
```
The next run picks up the new script, no restart needed. Crontab changes need a `docker compose restart`.