Skip to content

CE-3341: Fetch netbox hosts by configurable groups

Simon Rose requested to merge fetch_host_by_groups into develop

Previously we proposed using host limits to restrict deployments between instances. There are some tricks to this, mostly related to the fact that ansible host patterns cannot support a restriction of the form

(a or b) and (c or d)

This unfortunately means that this is not easy to make consistent with the addition of bulk deployments, where we would want to allow both

  • deployments restricted to group A or B (or...)
  • deployments triggered on hosts x or y (or ...)

The decision has been to restrict host selection to the groups instead, and then simply to limit the hosts as before.

Note that there appears to be a speedup obtained by performing multiple queries, one per group, instead of querying all the IOCs.

Note that there is some cleanup here, so viewing by commit is probably helpful. Most notably there is a big removal of unused "test" data, as well as a refactor of the paged fetching of data from NetBox.

Merge request reports