]> granicus.if.org Git - icinga2/commitdiff
Change PKI path from /etc/icinga2/pki to /var/lib/icinga2/pki
authorGunnar Beutner <gunnar.beutner@icinga.com>
Wed, 23 Aug 2017 10:18:45 +0000 (12:18 +0200)
committerGunnar Beutner <gunnar.beutner@icinga.com>
Tue, 12 Sep 2017 10:52:49 +0000 (12:52 +0200)
refs #5450

etc/icinga2/features-available/api.conf
lib/cli/nodesetupcommand.cpp
lib/cli/nodewizardcommand.cpp
lib/cli/pkiutility.cpp

index 0136de0b2289463a8a7f9572b3ef55af9e252134..588c4c6556d99c141cca6197b49bd7db845331fd 100644 (file)
@@ -3,9 +3,9 @@
  */
 
 object ApiListener "api" {
-  cert_path = SysconfDir + "/icinga2/pki/" + NodeName + ".crt"
-  key_path = SysconfDir + "/icinga2/pki/" + NodeName + ".key"
-  ca_path = SysconfDir + "/icinga2/pki/ca.crt"
+  cert_path = LocalStateDir + "/lib/icinga2/pki/" + NodeName + ".crt"
+  key_path = LocalStateDir + "/lib/icinga2/pki/" + NodeName + ".key"
+  ca_path = LocalStateDir + "/lib/icinga2/pki/ca.crt"
 
   ticket_salt = TicketSalt
 }
index 59c343dc0f11661d539a3659c0df9090fa015933..a80125080749b84aa201195181ceedaca8dec74f 100644 (file)
@@ -175,9 +175,9 @@ int NodeSetupCommand::SetupMaster(const boost::program_options::variables_map& v
            << " * The API listener is used for distributed monitoring setups.\n"
            << " */\n"
            << "object ApiListener \"api\" {\n"
-           << "  cert_path = SysconfDir + \"/icinga2/pki/\" + NodeName + \".crt\"\n"
-           << "  key_path = SysconfDir + \"/icinga2/pki/\" + NodeName + \".key\"\n"
-           << "  ca_path = SysconfDir + \"/icinga2/pki/ca.crt\"\n";
+           << "  cert_path = LocalStateDir + \"/lib/icinga2/pki/\" + NodeName + \".crt\"\n"
+           << "  key_path = LocalStateDir + \"/lib/icinga2/pki/\" + NodeName + \".key\"\n"
+           << "  ca_path = LocalStateDir + \"/lib/icinga2/pki/ca.crt\"\n";
 
        if (vm.count("listen")) {
                std::vector<String> tokens;
@@ -379,9 +379,9 @@ int NodeSetupCommand::SetupNode(const boost::program_options::variables_map& vm,
            << " * The API listener is used for distributed monitoring setups.\n"
            << " */\n"
            << "object ApiListener \"api\" {\n"
-           << "  cert_path = SysconfDir + \"/icinga2/pki/\" + NodeName + \".crt\"\n"
-           << "  key_path = SysconfDir + \"/icinga2/pki/\" + NodeName + \".key\"\n"
-           << "  ca_path = SysconfDir + \"/icinga2/pki/ca.crt\"\n";
+           << "  cert_path = LocalStateDir + \"/lib/icinga2/pki/\" + NodeName + \".crt\"\n"
+           << "  key_path = LocalStateDir + \"/lib/icinga2/pki/\" + NodeName + \".key\"\n"
+           << "  ca_path = LocalStateDir + \"/lib/icinga2/pki/ca.crt\"\n";
 
        if (vm.count("listen")) {
                std::vector<String> tokens;
index 42bee92f8a81139dcd5969fa83bbe8b474080550..37b80f9664570b654128ad9d6dfb9be45e891988 100644 (file)
@@ -91,7 +91,7 @@ int NodeWizardCommand::Run(const boost::program_options::variables_map& vm,
         * 5. Local CA
         * 6. New self signed certificate
         * 7. Request signed certificate from master
-        * 8. copy key information to /etc/icinga2/pki
+        * 8. copy key information to /var/lib/icinga2/pki
         * 9. enable ApiListener feature
         * 10. generate zones.conf with endpoints and zone objects
         * 11. set NodeName = cn in constants.conf
@@ -409,9 +409,9 @@ wizard_ticket:
                    << " * The API listener is used for distributed monitoring setups.\n"
                    << " */\n"
                    << "object ApiListener \"api\" {\n"
-                   << "  cert_path = SysconfDir + \"/icinga2/pki/\" + NodeName + \".crt\"\n"
-                   << "  key_path = SysconfDir + \"/icinga2/pki/\" + NodeName + \".key\"\n"
-                   << "  ca_path = SysconfDir + \"/icinga2/pki/ca.crt\"\n"
+                   << "  cert_path = LocalStateDir + \"/lib/icinga2/pki/\" + NodeName + \".crt\"\n"
+                   << "  key_path = LocalStateDir + \"/lib/icinga2/pki/\" + NodeName + \".key\"\n"
+                   << "  ca_path = LocalStateDir + \"/lib/icinga2/pki/ca.crt\"\n"
                    << "\n"
                    << "  accept_config = " << accept_config << "\n"
                    << "  accept_commands = " << accept_commands << "\n";
@@ -531,9 +531,9 @@ wizard_ticket:
                    << " * The API listener is used for distributed monitoring setups.\n"
                    << " */\n"
                    << "object ApiListener \"api\" {\n"
-                   << "  cert_path = SysconfDir + \"/icinga2/pki/\" + NodeName + \".crt\"\n"
-                   << "  key_path = SysconfDir + \"/icinga2/pki/\" + NodeName + \".key\"\n"
-                   << "  ca_path = SysconfDir + \"/icinga2/pki/ca.crt\"\n";
+                   << "  cert_path = LocalStateDir + \"/lib/icinga2/pki/\" + NodeName + \".crt\"\n"
+                   << "  key_path = LocalStateDir + \"/lib/icinga2/pki/\" + NodeName + \".key\"\n"
+                   << "  ca_path = LocalStateDir + \"/lib/icinga2/pki/ca.crt\"\n";
 
                if (!bind_host.IsEmpty())
                        fp << "  bind_host = \"" << bind_host << "\"\n";
index e43a3af667b71ad9dbddd28955de3c5fc4583c88..aeb385f9f6dee4652c18840a50cd093338ba9356 100644 (file)
@@ -36,7 +36,7 @@ using namespace icinga;
 
 String PkiUtility::GetPkiPath(void)
 {
-       return Application::GetSysconfDir() + "/icinga2/pki";
+       return Application::GetLocalStateDir() + "/lib/icinga2/pki";
 }
 
 String PkiUtility::GetLocalCaPath(void)