Differences
This shows you the differences between two versions of the page.
puppet_management [2020/11/16 16:31] – created andonovj | puppet_management [2020/11/16 16:54] (current) – [Auto Signing] andonovj | ||
---|---|---|---|
Line 8: | Line 8: | ||
====Auto Signing==== | ====Auto Signing==== | ||
- | Remember when we had to sign our certificate. What if we have 100 new servers, do you want to sign each certificate. With puppet we can configure auto signing, let's see how that will work with a new server: "puppetagentnew" | + | Remember when we had to sign our certificate. What if we have 100 new servers, do you want to sign each certificate. With puppet we can configure auto signing, let's see how that will work with a new server: "puppetslavetwo" |
+ | |||
+ | To create auto signing, we need to re-configure our master, by creating the following file: | ||
+ | |||
+ | ===Configure Master=== | ||
+ | < | ||
+ | [root@puppetmaster ~]# vi / | ||
+ | *.example.com | ||
+ | :wq | ||
+ | |||
+ | [root@puppetmaster ~]# systemctl restart puppetserver.service | ||
+ | [root@puppetmaster ~]# service puppetserver status | ||
+ | Redirecting to / | ||
+ | ● puppetserver.service - puppetserver Service | ||
+ | | ||
+ | | ||
+ | Process: 10616 ExecStop=/ | ||
+ | Process: 10788 ExecStart=/ | ||
+ | Main PID: 10811 (java) | ||
+ | Tasks: 40 (limit: 4915) | ||
+ | | ||
+ | | ||
+ | |||
+ | Nov 13 19:36:21 puppetmaster.example.com systemd[1]: puppetserver.service: | ||
+ | Nov 13 19:36:21 puppetmaster.example.com systemd[1]: Stopped puppetserver Service. | ||
+ | Nov 13 19:36:21 puppetmaster.example.com systemd[1]: Unit puppetserver.service entered failed state. | ||
+ | Nov 13 19:36:21 puppetmaster.example.com systemd[1]: puppetserver.service failed. | ||
+ | Nov 13 19:36:21 puppetmaster.example.com systemd[1]: Starting puppetserver Service... | ||
+ | Nov 13 19:36:53 puppetmaster.example.com systemd[1]: Started puppetserver Service. | ||
+ | [root@puppetmaster ~]# | ||
+ | </ | ||
+ | |||
+ | ===Configure Slave=== | ||
+ | After, we have restarted the master, we can start the agent on the puppetslavetwo server: | ||
+ | |||
+ | < | ||
+ | [root@puppetslavetwo ~]# service puppet start | ||
+ | Redirecting to / | ||
+ | [root@puppetslavetwo ~]# service puppet status | ||
+ | Redirecting to / | ||
+ | ● puppet.service - Puppet agent | ||
+ | | ||
+ | | ||
+ | Main PID: 1594 (puppet) | ||
+ | Tasks: 2 | ||
+ | | ||
+ | | ||
+ | |||
+ | Nov 16 11:48:32 puppetslavetwo.example.com systemd[1]: Started Puppet agent. | ||
+ | Nov 16 11:48:39 puppetslavetwo.example.com puppet-agent[1594]: | ||
+ | Nov 16 11:48:42 puppetslavetwo.example.com puppet-agent[1606]: | ||
+ | [root@puppetslavetwo ~]# | ||
+ | </ | ||
+ | |||
+ | ===Verification=== | ||
+ | To verify, we can check both the master, if he signed it and/or check the agent | ||
+ | |||
+ | < | ||
+ | --Check certificate | ||
+ | [root@puppetmaster ~]# puppetserver ca list --all | ||
+ | Signed Certificates: | ||
+ | puppetmaster.example.com | ||
+ | puppetslave.example.com | ||
+ | puppetslavetwo.example.com | ||
+ | |||
+ | --Log | ||
+ | 2020-11-13T19: | ||
+ | 2020-11-13T19: | ||
+ | </ | ||
+ | |||
+ | < | ||
+ | [root@puppetslavetwo ~]# puppet agent -tv | ||
+ | Info: Using configured environment ' | ||
+ | Info: Retrieving pluginfacts | ||
+ | Info: Retrieving plugin | ||
+ | Info: Retrieving locales | ||
+ | Info: Caching catalog for puppetslavetwo.example.com | ||
+ | Info: Applying configuration version ' | ||
+ | Notice: Applied catalog in 0.02 seconds | ||
+ | [root@puppetslavetwo ~]# | ||
+ | </ | ||