|
| 1 | +fb_letsencrypt Cookbook |
| 2 | +======================= |
| 3 | + |
| 4 | +Requirements |
| 5 | +------------ |
| 6 | +For RHEL or CentOS Stream, EPEL must be already setup. |
| 7 | + |
| 8 | +Attributes |
| 9 | +---------- |
| 10 | +* node['fb_letsencrypt']['manage_packages'] |
| 11 | +* node['fb_letsencrypt']['certbot_plugins'] |
| 12 | +* node['fb_letsencrypt']['enable_package_timer'] |
| 13 | + |
| 14 | +Usage |
| 15 | +----- |
| 16 | +### Managing packages |
| 17 | + |
| 18 | +By default, this cookbook will manage certbot-related packages. If you do not |
| 19 | +want this, set `node['fb_letsencrypt']['manage_packages']` to `false`. |
| 20 | + |
| 21 | +This cookbook will install both certbot itself as well as any plugin packages |
| 22 | +specified in `node['fb_letsencrypt']['certbot_plugins']`, which should only |
| 23 | +include the name of the plugin, not the name of the package. For example: |
| 24 | + |
| 25 | +```ruby |
| 26 | +node.default['fb_letsencrypt']['certbot_plugins'] += [ |
| 27 | + 'apache', |
| 28 | + 'dns-cloudflare', |
| 29 | +] |
| 30 | +``` |
| 31 | + |
| 32 | +### Renewal Timers |
| 33 | + |
| 34 | +The certbot package includes a system timer to renew certificates, which we |
| 35 | +will keep enabled, by default. If you prefer to manage your own method of |
| 36 | +running reneals, you can set `node['fb_letsencrypt']['enable_package_timer']` |
| 37 | +to `false`, and this cookbook will disable it so that you may do whatever you |
| 38 | +like instead. |
| 39 | + |
| 40 | +### Renewal Configuration |
| 41 | + |
| 42 | +The configuration files for certificate renewals - while human-editable, are |
| 43 | +meant to be generated by initial certificate generation. As such we do not |
| 44 | +generate or manage them. |
| 45 | + |
| 46 | +### Helper functions |
| 47 | + |
| 48 | +This cookbook includes various helper functions to make it easy to reference |
| 49 | +your LetsEncrypt certificates from other cookbooks and to follow best |
| 50 | +practices. |
| 51 | + |
| 52 | +#### FB::LetsEncrypt.cert(node, name) |
| 53 | + |
| 54 | +This method returns the path you should use for the certificate in your |
| 55 | +service. It actually returns the `fullchain.pem` which is what you should pass |
| 56 | +to 'certificate' configuration for your service in nearly all cases. |
| 57 | + |
| 58 | +This method is also aliased as `certificate` and `fullchain`, should you prefer |
| 59 | +those. |
| 60 | + |
| 61 | +#### FB::LetsEncrypt.privkey(node, name) |
| 62 | + |
| 63 | +This method returns the path to the private key. It is aliased as `privatekey` |
| 64 | +if you prefer. |
| 65 | + |
| 66 | +#### FB::LetsEncrypt.minimal_cert(node, name) |
| 67 | + |
| 68 | +In the event you really want just the leaf certificate, you can call |
| 69 | +`minimal_cert` and it will return the path to `cert.pem`. Note that this is |
| 70 | +dangerous and will likely lead to certificate validation errors for your |
| 71 | +service. |
| 72 | + |
| 73 | +#### FB::LetsEncrypt.onlychain(node, name) |
| 74 | + |
| 75 | +This method returns the path to `chain.pem`. This is rarely needed. |
0 commit comments