Commit Graph

12 Commits

Author SHA1 Message Date
927bcabc97 test: ipv6 end-to-end scenarios
vm01 gains a primary IPv6 next to its IPv4, one standalone IPv6 address
joins the dataset; covers ip_version on both sources, combination with
filters, the IPv6-preferring behaviour of netbox's combined primary IP,
and the invalid value error path.
2026-08-25 14:53:24 +02:00
c1f0b4f724 feat: ip_version option to restrict inventories to ipv4 or ipv6
inventory.ip_version (or NETBOX_INVENTORY_IP_VERSION): both (default),
v4 or v6; the ip-addresses source filters by family server-side, the
virtual-machines source picks primary_ip4/primary_ip6 for ansible_host.
2026-08-25 14:53:24 +02:00
9dbcdfad66 docs: end-to-end testing and v2 token documentation 2026-08-25 13:47:35 +02:00
c3d3165a54 test: end-to-end scenarios against a live netbox
seed.py populates the stack through the API: a read-only user with a
self-provisioned token, tenants, sites, clusters, a VRF, virtual
machines (one with a primary IP) and standalone addresses; the tests
run the real inventory script against every source/filter combination,
every error path and the ansible --list/--host protocol.
2026-08-25 13:47:18 +02:00
706a12b8e4 feat: throwaway netbox deployment for end-to-end testing
compose stack modelled on the production netbox deployment (same pinned
images, worker, healthchecks) minus traefik: the API is served straight
on localhost and nothing survives an e2e-down.
2026-08-25 13:47:18 +02:00
e4a1e6a472 feat: bearer auth for netbox 4.5 v2 api tokens
v2 tokens (nbt_<key>.<secret>) are sent as Authorization: Bearer, legacy
tokens keep the Token scheme; NetBox drops legacy token support in 4.7.
2026-08-25 13:47:18 +02:00
4195e7c3c3 docs: installation, configuration, filter and behaviour documentation 2026-08-25 13:12:14 +02:00
362e71bff1 test: unit tests for config, filters, client and inventory building
pytest suite with mocked NetBox API responses, plus a makefile driving
venv setup, tests, linting and formatting.
2026-08-25 13:11:20 +02:00
4138fef307 feat: tenant, named, vrf, domain, cluster and site filters
one filter option plus its value, set in config or via
NETBOX_INVENTORY_FILTER / NETBOX_INVENTORY_FILTER_VALUE:
- tenant (both sources), resolved by name server-side
- named (ip-addresses), only addresses with a DNS name, deduplicated
- vrf (ip-addresses), resolved by name server-side
- domain (both sources), hostname ends with the domain
- cluster, site (virtual-machines), resolved by name server-side
2026-08-25 13:10:12 +02:00
43cab4e7d8 feat: ip address and virtual machine inventory sources
hosts land in a single "netbox" group with hostvars under _meta; IP
addresses use the DNS name as inventory hostname when set, virtual
machines expose their primary IP as ansible_host when they have one.
2026-08-25 13:09:33 +02:00
7912dacf95 feat: configuration loading and netbox api client
config.yaml next to the script (or $NETBOX_INVENTORY_CONFIG) with environment
variable overrides, requests session with token auth, paginated list fetching
and readable error reporting.
2026-08-25 13:09:09 +02:00
44e7dd50b5 first commit 2026-08-25 13:08:30 +02:00