--- /dev/null
+define nginx::cert(
+ $address
+)
+{
+ ssl::cert { "$address":
+ main => true,
+ notify => Service['nginx'],
+ }
+
+ ssl::check { "$address":
+ file => true,
+ }
+
+ Service["nginx"] {
+ require => [ Package["nginx"],
+ File["/etc/nginx/sites-enabled/${address}"],
+ File["/etc/ssl/private/${address}.pem"],
+ File["/etc/ssl/certs/${address}.crt"] ],
+ }
+}
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
-class nginx inherits nginx::base(
- $deploy_certs = true
-) {
+class nginx inherits nginx::base {
include ssl
# See https://weakdh.org/
notify => Service['nginx'],
}
- case $deploy_certs {
- true: {
- ssl::cert { "$::domain":
- main => true,
- notify => Service['nginx'],
- }
-
- ssl::check { "$::domain":
- file => true,
- }
-
- # For SNI
- ssl::cert { "example.org":
- notify => Service['nginx'],
- }
-
- Service["nginx"] {
- require => [ Package["nginx"],
- File["/etc/nginx/sites-enabled/${::domain}"],
- File["/etc/ssl/private/${::domain}.pem"],
- File["/etc/ssl/certs/${::domain}.crt"] ],
- }
- }
- }
-
# Default site
nginx::base::site { "default":
ensure => present,