Utility::RenameFile(tempApiPath, apipath);
/* update constants.conf with NodeName = CN + TicketSalt = random value */
- if (cn != Utility::GetFQDN()) {
+ if (endpointName != Utility::GetFQDN()) {
Log(LogWarning, "cli")
- << "CN '" << cn << "' does not match the default FQDN '" << Utility::GetFQDN() << "'. Requires update for NodeName constant in constants.conf!";
+ << "CN/Endpoint name '" << endpointName << "' does not match the default FQDN '" << Utility::GetFQDN() << "'. Requires update for NodeName constant in constants.conf!";
}
- NodeUtility::UpdateConstant("NodeName", cn);
- NodeUtility::UpdateConstant("ZoneName", cn);
+ NodeUtility::UpdateConstant("NodeName", endpointName);
+ NodeUtility::UpdateConstant("ZoneName", zoneName);
String salt = RandomString(16);
NodeUtility::GenerateNodeIcingaConfig(endpointName, zoneName, parentZoneName, vm["endpoint"].as<std::vector<std::string> >(), globalZones);
/* update constants.conf with NodeName = CN */
- if (cn != Utility::GetFQDN()) {
+ if (endpointName != Utility::GetFQDN()) {
Log(LogWarning, "cli")
- << "CN '" << cn << "' does not match the default FQDN '" << Utility::GetFQDN() << "'. Requires an update for the NodeName constant in constants.conf!";
+ << "CN/Endpoint name '" << endpointName << "' does not match the default FQDN '"
+ << Utility::GetFQDN() << "'. Requires an update for the NodeName constant in constants.conf!";
}
- NodeUtility::UpdateConstant("NodeName", cn);
- NodeUtility::UpdateConstant("ZoneName", vm["zone"].as<std::string>());
+ NodeUtility::UpdateConstant("NodeName", endpointName);
+ NodeUtility::UpdateConstant("ZoneName", zoneName);
if (!ticket.IsEmpty()) {
String ticketPath = ApiListener::GetCertsDir() + "/ticket";
* 8. copy key information to /var/lib/icinga2/certs
* 9. enable ApiListener feature
* 10. generate zones.conf with endpoints and zone objects
- * 11. set NodeName = cn in constants.conf
+ * 11. set NodeName = cn and ZoneName in constants.conf
* 12. disable conf.d directory?
* 13. reload icinga2, or tell the user to
*/
/* Generate node configuration. */
NodeUtility::GenerateNodeIcingaConfig(endpointName, zoneName, parentZoneName, endpoints, globalZones);
- if (cn != Utility::GetFQDN()) {
+ if (endpointName != Utility::GetFQDN()) {
Log(LogWarning, "cli")
- << "CN '" << cn << "' does not match the default FQDN '"
+ << "CN/Endpoint name '" << endpointName << "' does not match the default FQDN '"
<< Utility::GetFQDN() << "'. Requires update for NodeName constant in constants.conf!";
}
- NodeUtility::UpdateConstant("NodeName", cn);
- NodeUtility::UpdateConstant("ZoneName", cn);
+ NodeUtility::UpdateConstant("NodeName", endpointName);
+ NodeUtility::UpdateConstant("ZoneName", zoneName);
if (!ticket.IsEmpty()) {
String ticketPath = ApiListener::GetCertsDir() + "/ticket";
NodeUtility::CreateBackupFile(NodeUtility::GetConstantsConfPath());
- NodeUtility::UpdateConstant("NodeName", cn);
- NodeUtility::UpdateConstant("ZoneName", cn);
+ NodeUtility::UpdateConstant("NodeName", endpointName);
+ NodeUtility::UpdateConstant("ZoneName", zoneName);
String salt = RandomString(16);