As requested in discussion on #96588, instead of having specific ensureDefaultAgentPolicy functions, we should use Kibana config defaults to define the default policies.
Use the Preconfiguration API to initialize these default policies, move the information in DEFAULT_AGENT_POLICY/DEFAULT_FLEET_SERVER_AGENT_POLICY into the config default values, and allow the user to override them using kibana.yml.
ETA: This means that if the user defines policies in kibana.yml and none of them have the is_default/is_default_fleet_server flag, no "default policies" will be created. This seems to be okay, as the is_default flags should only be used by the plugin setup step to determine whether or not an agent policy has been created.
As requested in discussion on #96588, instead of having specific
ensureDefaultAgentPolicyfunctions, we should use Kibana config defaults to define the default policies.Use the Preconfiguration API to initialize these default policies, move the information in
DEFAULT_AGENT_POLICY/DEFAULT_FLEET_SERVER_AGENT_POLICYinto the config default values, and allow the user to override them usingkibana.yml.ETA: This means that if the user defines policies in
kibana.ymland none of them have theis_default/is_default_fleet_serverflag, no "default policies" will be created. This seems to be okay, as theis_defaultflags should only be used by the plugin setup step to determine whether or not an agent policy has been created.