mirror of
https://github.com/Icinga/icinga2.git
synced 2025-07-24 06:05:01 +02:00
Merge pull request #6748 from Icinga/bugfix/api-setup-fails-missing-confd
Fix api setup to automatically create the conf.d directory
This commit is contained in:
commit
4c1a54073c
@ -152,6 +152,15 @@ bool ApiSetupUtility::SetupMasterCertificates(const String& cn)
|
|||||||
|
|
||||||
bool ApiSetupUtility::SetupMasterApiUser()
|
bool ApiSetupUtility::SetupMasterApiUser()
|
||||||
{
|
{
|
||||||
|
if (!Utility::PathExists(GetConfdPath())) {
|
||||||
|
Log(LogWarning, "cli")
|
||||||
|
<< "Path '" << GetConfdPath() << "' do not exist.";
|
||||||
|
Log(LogInformation, "cli")
|
||||||
|
<< "Creating path '" << GetConfdPath() << "'.";
|
||||||
|
|
||||||
|
Utility::MkDirP(GetConfdPath(), 0755);
|
||||||
|
}
|
||||||
|
|
||||||
String api_username = "root"; // TODO make this available as cli parameter?
|
String api_username = "root"; // TODO make this available as cli parameter?
|
||||||
String api_password = RandomString(8);
|
String api_password = RandomString(8);
|
||||||
String apiUsersPath = GetConfdPath() + "/api-users.conf";
|
String apiUsersPath = GetConfdPath() + "/api-users.conf";
|
||||||
|
Loading…
x
Reference in New Issue
Block a user