Location changes kick the IPAM reconcile
A machine's NetBox device follows a move at once, not at the next pass. Refs #10 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
2e1a2176cd
commit
dc6eb55b26
1 file changed
+2
@@ -136,6 +136,7 @@ func (a *App) handleLocation(w http.ResponseWriter, r *http.Request) {
|
||||
_ = a.store.AddEvent(r.Context(), m.ID, "location", l.String())
|
||||
m, _ = a.store.Get(r.Context(), m.ID)
|
||||
a.retag(r.Context(), []*Machine{m}) // rules may look at the rack
|
||||
a.kickIPAM() // the NetBox device follows (ipam.device_sync)
|
||||
writeJSON(w, 200, obj{"id": m.ID, "location": m.Location})
|
||||
}
|
||||
|
||||
@@ -302,6 +303,7 @@ func (a *App) handleLocationImport(w http.ResponseWriter, r *http.Request) {
|
||||
}
|
||||
if !dry {
|
||||
a.retag(r.Context(), nil)
|
||||
a.kickIPAM()
|
||||
}
|
||||
if matched == nil {
|
||||
matched = []obj{}
|
||||
|
||||
Reference in new issue
Block a user