Management framework: re-trigger deployment upon controller launch

A resilience feature: when a booting controller has a previously deployed
configuration (just reloaded from persistent state), it now triggers a
deployment. When agents at this point run something else, this restores the
controller's understanding of what's deployed, and if the agents do still run
this configuration, does nothing since agents ignore deployment of a
configuration they already run.
This commit is contained in:
Christian Kreibich 2022-06-19 17:43:37 -07:00
parent c4862e7c5e
commit 1faf1ab8b7

View file

@ -1344,4 +1344,15 @@ event zeek_init()
Broker::subscribe(Management::Controller::topic); Broker::subscribe(Management::Controller::topic);
Management::Log::info(fmt("controller is live, Broker ID %s", Broker::node_id())); Management::Log::info(fmt("controller is live, Broker ID %s", Broker::node_id()));
# If we have a persisted deployed configuration, we need to make sure
# it's actually running. The agents involved might be gone, running a
# different config, etc. We simply run a deployment: agents already
# running this configuration will do nothing.
if ( DEPLOYED in g_configs )
{
local req = Management::Request::create();
req$deploy_state = DeployState($config=g_configs[DEPLOYED], $is_internal=T);
deploy(req);
}
} }