forked from martinhoefling/letsencrypt-formula
-
Notifications
You must be signed in to change notification settings - Fork 149
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #83 from netmanagers/allow-mixing-authenticators
feat(domains): allow to specify different authenticators/installers Performing "selfie-merge", in line with community conventions:- https://github.com/saltstack/salt/blob/develop/doc/topics/development/conventions/formulas.rst#get-involved-creating-new-formulas
- Loading branch information
Showing
10 changed files
with
361 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -26,6 +26,9 @@ letsencrypt: | |
config: | ||
server: https://acme-v02.api.letsencrypt.org/directory | ||
email: [email protected] | ||
# Don't add an authenticator here if you need (or expect) to mix authentication | ||
# methods. | ||
# In such case, use authenticators below | ||
authenticator: webroot | ||
webroot-path: /var/lib/www | ||
agree-tos: true | ||
|
@@ -47,6 +50,24 @@ letsencrypt: | |
user: root | ||
group: root | ||
mode: 755 | ||
# If you need to manage certificates for a few domainsets on the same node, but | ||
# the authentication for each of these vary, you need to specify | ||
# an authenticator for each of the domainsets instead of setting it in cli.ini | ||
# Set them in this parameter. You can use the reserved name `default` to set | ||
# the authenticator that will be used in case no other is specified for a | ||
# particular domainset. | ||
# Default: authenticators: {} | ||
|
||
authenticators: | ||
default: nginx | ||
mail: route53 | ||
# As with `authenticators` above, you can specify different install methods for | ||
# your different certificates. The installer set as `default` will be used to | ||
# all the domainsets with no particular installer | ||
# Default: installers: {} | ||
installers: | ||
default: nginx | ||
|
||
domainsets: | ||
www: | ||
- example.com | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
# InSpec Profile: `domains` | ||
|
||
This shows the implementation of the `domains` InSpec [profile](https://github.com/inspec/inspec/blob/master/docs/profiles.md). | ||
|
||
## Verify a profile | ||
|
||
InSpec ships with built-in features to verify a profile structure. | ||
|
||
```bash | ||
$ inspec check domains | ||
Summary | ||
------- | ||
Location: domains | ||
Profile: profile | ||
Controls: 4 | ||
Timestamp: 2019-06-24T23:09:01+00:00 | ||
Valid: true | ||
|
||
Errors | ||
------ | ||
|
||
Warnings | ||
-------- | ||
``` | ||
|
||
## Execute a profile | ||
|
||
To run all **supported** controls on a local machine use `inspec exec /path/to/profile`. | ||
|
||
```bash | ||
$ inspec exec domains | ||
.. | ||
|
||
Finished in 0.0025 seconds (files took 0.12449 seconds to load) | ||
8 examples, 0 failures | ||
``` | ||
|
||
## Execute a specific control from a profile | ||
|
||
To run one control from the profile use `inspec exec /path/to/profile --controls name`. | ||
|
||
```bash | ||
$ inspec exec domains --controls package | ||
. | ||
|
||
Finished in 0.0025 seconds (files took 0.12449 seconds to load) | ||
1 examples, 0 failures | ||
``` | ||
|
||
See an [example control here](https://github.com/inspec/inspec/blob/master/examples/profile/controls/example.rb). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
# frozen_string_literal: true | ||
|
||
%w[ | ||
cert | ||
chain | ||
fullchain | ||
privkey | ||
].each do |f| | ||
describe file("/etc/letsencrypt/archive/www/#{f}1.pem") do | ||
it { should be_file } | ||
it { should be_owned_by 'root' } | ||
it { should be_grouped_into 'root' } | ||
it { should be_readable } | ||
its('size') { should be > 1 } | ||
end | ||
|
||
describe file("/etc/letsencrypt/live/www/#{f}.pem") do | ||
it { should be_symlink } | ||
end | ||
end | ||
describe file('/etc/letsencrypt/live/www/fullchain-privkey.pem') do | ||
it { should be_file } | ||
it { should be_owned_by 'root' } | ||
it { should be_grouped_into 'root' } | ||
it { should be_readable } | ||
its('size') { should be > 1 } | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
# -*- coding: utf-8 -*- | ||
# vim: ft=yaml | ||
--- | ||
name: domains | ||
title: letsencrypt formula | ||
maintainer: SaltStack Formulas | ||
license: Apache-2.0 | ||
summary: Verify that certificates can be requested/issued correctly | ||
depends: | ||
- name: share | ||
path: test/integration/share | ||
supports: | ||
- platform-name: debian | ||
- platform-name: ubuntu |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
# -*- coding: utf-8 -*- | ||
# vim: ft=yaml | ||
--- | ||
## Pebble does not work correctly with certbot < 0.30, | ||
## so don't test it with stretch-backports | ||
letsencrypt: | ||
config: | ||
server: https://localhost:14000/dir | ||
agree-tos: true | ||
renew-by-default: true | ||
email: [email protected] | ||
authenticators: | ||
default: standalone | ||
domainsets: | ||
www: | ||
- letsencrypt-formula.example.com |
Oops, something went wrong.