From: Michael Friedrich Date: Tue, 21 Oct 2014 14:04:20 +0000 (+0200) Subject: CLI: Add agent setup command X-Git-Tag: v2.2.0~311 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=9d0f15d2c642708f80e6e80b6a6143753c2619c2;p=icinga2 CLI: Add agent setup command refs #7423 --- diff --git a/lib/cli/agentsetupcommand.cpp b/lib/cli/agentsetupcommand.cpp index 6d9341d13..17115c29b 100644 --- a/lib/cli/agentsetupcommand.cpp +++ b/lib/cli/agentsetupcommand.cpp @@ -81,10 +81,43 @@ int AgentSetupCommand::Run(const boost::program_options::variables_map& vm, cons bool AgentSetupCommand::SetupMaster(const boost::program_options::variables_map& vm, const std::vector& ap) { + /* 1. Generate a new CA, if not already existing */ + if (PkiUtilility::NewCa() > 0) { + Log(LogWarning, "cli") + << "Found CA, skipping and using the existing one.\n"; + } + + /* 2. Generate a self signed certificate */ + + /* 3. Copy certificates to /etc/icinga2/pki */ + + /* 4. read zones.conf and update with zone + endpoint information */ + + /* 5. enable the ApiListener config (verifiy its data) */ + + /* 5. tell the user to reload icinga2 */ + return true; } bool AgentSetupCommand::SetupAgent(const boost::program_options::variables_map& vm, const std::vector& ap) { + /* 1. require ticket number (generated on master) */ + + /* 2. trusted cert must be passed (retrieved by the user with 'pki save-cert' before) */ + + /* 3. retrieve CN and pass it if requested (defaults to FQDN) */ + + /* 4. pki request a signed certificate from the master */ + + /* 5. get public key signed by the master, private key and ca.crt and copy it to /etc/icinga2/pki */ + + /* 6. generate local zones.conf with zone+endpoint */ + + /* 7. update constants.conf with NodeName = CN */ + + /* 8. tell the user to reload icinga2 */ + + return true; }