apps:puppet
Differences
This shows you the differences between two versions of the page.
Next revision | Previous revision | ||
apps:puppet [2019-08-10 16:53] – Initial writing jens | apps:puppet [2024-05-20 10:15] (current) – [Connecting] Syntax jens | ||
---|---|---|---|
Line 1: | Line 1: | ||
====== Puppet ====== | ====== Puppet ====== | ||
- | Even if you manage just a handful or two servers, [[https:// | + | Even if you manage just a handful or two of servers, [[https:// |
Somehow, I could not find very many or good manuals on how to set up your own (basic) Puppet server on Debian, so I decided to write my own. | Somehow, I could not find very many or good manuals on how to set up your own (basic) Puppet server on Debian, so I decided to write my own. | ||
- | ==== Installation & Configuration ==== | + | ===== Installation & Configuration |
- | The installation in Debian | + | The installation in Debian is -- as always in Debian -- straight forward. Just run an |
- | + | <code bash> | |
- | apt install | + | apt install puppet-agent puppetserver |
+ | </ | ||
| | ||
- | That last package is not really needed but comes in really handy when editing your Puppet manifests in vim and you want syntax highlighting. While this would be more needed on a git client | + | That last package is not really needed but comes in really handy when editing your Puppet manifests in vim and you want syntax highlighting. While this would be more needed on a [[:apps:git|git]] |
As for the main configuration file ''/ | As for the main configuration file ''/ | ||
- | ==== Manifests ==== | + | ===== Manifests |
Your manifests should be in ''/ | Your manifests should be in ''/ | ||
Line 28: | Line 29: | ||
├── module2 | ├── module2 | ||
│ | │ | ||
- | │ | + | │ |
- | │ | + | │ |
└── moduleX | └── moduleX | ||
├── examples | ├── examples | ||
Line 35: | Line 36: | ||
└── manifests | └── manifests | ||
</ | </ | ||
+ | |||
+ | Each '' | ||
+ | |||
+ | < | ||
+ | # DeskTux main Puppet Configuration | ||
+ | include module1 | ||
+ | include module2 | ||
+ | include moduleX | ||
+ | </ | ||
+ | |||
+ | In the modules, the '' | ||
+ | |||
+ | < | ||
+ | include moduleX | ||
+ | </ | ||
+ | |||
+ | That way, you can easily test the code of that module by using '' | ||
+ | |||
+ | Of course, before testing your code, you should first run it through '' | ||
+ | |||
+ | ===== Clients ===== | ||
+ | ==== Connecting ==== | ||
+ | Of course, your Puppet server will be useless if it only manages itself. To connect clients to your Puppet server, make sure it is reachable on port 8140/TCP (both IPv4 and IPv6 work). | ||
+ | |||
+ | On the client, install Puppet by running '' | ||
+ | |||
+ | <code ini> | ||
+ | [agent] | ||
+ | server = your.puppet.server | ||
+ | </ | ||
+ | |||
+ | Afterwards, run '' | ||
+ | <code bash> | ||
+ | root@puppet: | ||
+ | " | ||
+ | </ | ||
+ | |||
+ | To accept that certificate just run | ||
+ | |||
+ | puppetserver ca sign --certname < | ||
+ | |||
+ | and you are good to go. From now on, that system will be managed by your Puppet server. To test this you can run a '' | ||
+ | |||
+ | ==== Removing ==== | ||
+ | In case you need to remove (decommission) a client, you can list all available certificates with | ||
+ | |||
+ | puppetserver ca list --all | ||
+ | |||
+ | and then | ||
+ | |||
+ | puppetserver ca clean --certname < | ||
+ | | ||
+ | Don't forget to remove that client from backup and monitoring ;-) | ||
+ | |||
+ | ====== What next? ====== | ||
+ | Now, it might be a good idea to manage your Puppet code from your workstation using [[git]]. That way you do not need to log in to the Puppet server all the time to make changes to your code as root. | ||
+ | |||
+ | ~~DISCUSSION~~ |
apps/puppet.1565455987.txt.gz · Last modified: 2019-08-10 16:53 by jens