Differences
This shows you the differences between two versions of the page.
puppet_configure_master_client [2020/11/16 16:11] – created andonovj | puppet_configure_master_client [2020/11/16 16:21] (current) – andonovj | ||
---|---|---|---|
Line 1: | Line 1: | ||
=====Overview===== | =====Overview===== | ||
- | As shown in the previous section, we have configured | + | From the previous section, we have installed the binaries for both: Agent & Server. |
+ | In this section, we will configure them and sign the certificate: | ||
+ | |||
+ | |||
+ | =====Configuration===== | ||
+ | For the configuration, | ||
+ | |||
+ | ====Configure Master==== | ||
+ | We can start the service as follows: | ||
+ | |||
+ | < | ||
+ | [root@puppetmaster etc]# service puppetserver start | ||
+ | Redirecting to / | ||
+ | [root@puppetmaster etc]# service puppetserver status | ||
+ | Redirecting to / | ||
+ | ● puppetserver.service - puppetserver Service | ||
+ | | ||
+ | | ||
+ | Process: 7345 ExecStart=/ | ||
+ | Main PID: 7368 (java) | ||
+ | Tasks: 40 (limit: 4915) | ||
+ | | ||
+ | | ||
+ | |||
+ | Nov 13 16:49:35 puppetmaster.example.com systemd[1]: Starting puppetserver Service... | ||
+ | Nov 13 16:50:11 puppetmaster.example.com systemd[1]: Started puppetserver Service. | ||
+ | [root@puppetmaster etc]# | ||
+ | </ | ||
+ | |||
+ | As stated before, the agent is the one pulling the requests from the master, but before it can do that, the connection between them NEEDS to be secure. Secure in the IT world means, certificates, | ||
+ | |||
+ | < | ||
+ | [root@puppetmaster certificate_requests]# | ||
+ | Signed Certificates: | ||
+ | puppetmaster.example.com | ||
+ | [root@puppetmaster certificate_requests]# | ||
+ | </ | ||
+ | |||
+ | So we see that the master has his own certificate | ||
+ | |||
+ | ====Configure Agent==== | ||
+ | < | ||
+ | [root@puppetagent puppet]# vi / | ||
+ | # This file can be used to override the default puppet settings. | ||
+ | # See the following links for more details on what settings are available: | ||
+ | # - https:// | ||
+ | # - https:// | ||
+ | # - https:// | ||
+ | # - https:// | ||
+ | |||
+ | [main] | ||
+ | certserver = puppetslave.example.com | ||
+ | server = puppetmaster.example.com | ||
+ | |||
+ | :wq | ||
+ | |||
+ | </ | ||
+ | |||
+ | After that, we can start the Agent. | ||
+ | < | ||
+ | [root@puppetagent puppet]# service puppet start | ||
+ | Redirecting to / | ||
+ | [root@puppetagent puppet]# service puppet status | ||
+ | Redirecting to / | ||
+ | ● puppet.service - Puppet agent | ||
+ | | ||
+ | | ||
+ | Main PID: 26262 (puppet) | ||
+ | Tasks: 2 | ||
+ | | ||
+ | | ||
+ | |||
+ | Nov 13 17:23:04 puppetslave.example.com systemd[1]: Started Puppet agent. | ||
+ | [root@puppetagent puppet]# | ||
+ | </ | ||
+ | |||
+ | ====Sign Certificate==== | ||
+ | Since the agent started (and hopefully not mistakes) the master should' | ||
+ | |||
+ | < | ||
+ | [root@puppetmaster certificate_requests]# | ||
+ | Requested Certificates: | ||
+ | puppetslave.example.com | ||
+ | Signed Certificates: | ||
+ | puppetmaster.example.com | ||
+ | </ | ||
+ | |||
+ | Now, we have 2 certiciates :), so let's approve our agent. | ||
+ | |||
+ | < | ||
+ | [root@puppetmaster certificate_requests]# | ||
+ | Successfully signed certificate request for puppetslave.example.com | ||
+ | [root@puppetmaster certificate_requests]# | ||
+ | [root@puppetmaster certificate_requests]# | ||
+ | Signed Certificates: | ||
+ | puppetmaster.example.com | ||
+ | puppetslave.example.com | ||
+ | [root@puppetmaster certificate_requests]# | ||
+ | </ | ||
+ | |||
+ | From now on, we will have trusted connection between the Agent/ | ||
+ | |||
+ | =====Verification===== | ||
+ | We can verify the connection and the pull from the Agent as follows: | ||
+ | |||
+ | < | ||
+ | [root@puppetagent puppet]# puppet agent --test --verbose | ||
+ | Info: csr_attributes file loading from / | ||
+ | Info: Creating a new SSL certificate request for puppetslave.example.com | ||
+ | Info: Certificate Request fingerprint (SHA256): 1F: | ||
+ | Info: Downloaded certificate for puppetslave.example.com from https:// | ||
+ | Info: Using configured environment ' | ||
+ | Info: Retrieving pluginfacts | ||
+ | Info: Retrieving plugin | ||
+ | Info: Retrieving locales | ||
+ | Info: Caching catalog for puppetslave.example.com | ||
+ | Info: Applying configuration version ' | ||
+ | Info: Creating state file / | ||
+ | Notice: Applied catalog in 0.03 seconds | ||
+ | [root@puppetagent puppet]# puppet agent --test --verbose | ||
+ | Info: Using configured environment ' | ||
+ | Info: Retrieving pluginfacts | ||
+ | Info: Retrieving plugin | ||
+ | Info: Retrieving locales | ||
+ | Info: Caching catalog for puppetslave.example.com | ||
+ | Info: Applying configuration version ' | ||
+ | Notice: Applied catalog in 0.01 seconds | ||
+ | [root@puppetagent puppet]# | ||
+ | </ |