Add feature to specify a custom endpoint name for a host

- Render Endpoint and Zone with a different name per host
- Add custom variable `_director_custom_endpoint_name` to a host with that name
- Update `command_endpoint` behavior in services to use custom var or hostname
- Includes a feature flag that needs to be enabled
This commit is contained in:
Markus Frosch 2021-10-21 14:33:14 +02:00 committed by Thomas Gelf
parent 8237d84cdb
commit 4f959572f2
1 changed files with 2 additions and 5 deletions

View File

@ -252,14 +252,11 @@ class IcingaHost extends IcingaObject implements ExportInterface
$config->configFile($pre . 'agent_zones')->addObject($zone);
}
protected function renderCustom_endpoint_name()
protected function renderCustom_endpoint_name($value)
{
// When feature flag feature_custom_endpoint is enabled, render custom var
if ($this->connection->settings()->get('feature_custom_endpoint') === 'y') {
return c::renderKeyValue(
'vars._director_custom_endpoint_name',
c::renderPhpValue($this->get('custom_endpoint_name'))
);
return c::renderKeyValue('vars._director_custom_endpoint_name', c::renderString($value));
}
return '';