summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSilvio Rhatto <rhatto@riseup.net>2015-05-23 11:32:39 -0300
committerSilvio Rhatto <rhatto@riseup.net>2015-05-23 11:32:39 -0300
commita9436d2739650b4b03e45488d27001edceb8d8a0 (patch)
tree403040a07ff1bfbb7db9154fdddc930c74382572
parent7aeb5a4c3353b8abab3d6e6b1d32b9d1fdf09ee8 (diff)
downloadpuppet-nginx-a9436d2739650b4b03e45488d27001edceb8d8a0.tar.gz
puppet-nginx-a9436d2739650b4b03e45488d27001edceb8d8a0.tar.bz2
Defines nginx::cert
-rw-r--r--manifests/cert.pp20
-rw-r--r--manifests/init.pp29
2 files changed, 21 insertions, 28 deletions
diff --git a/manifests/cert.pp b/manifests/cert.pp
new file mode 100644
index 0000000..81a5f4b
--- /dev/null
+++ b/manifests/cert.pp
@@ -0,0 +1,20 @@
+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"] ],
+ }
+}
diff --git a/manifests/init.pp b/manifests/init.pp
index 7c827de..dbbf4f4 100644
--- a/manifests/init.pp
+++ b/manifests/init.pp
@@ -16,9 +16,7 @@
# 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/
@@ -30,31 +28,6 @@ class nginx inherits nginx::base(
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,