From dbb86f2bc49d6ccf39c666570a2bcde5651739ba Mon Sep 17 00:00:00 2001 From: Florian Bittner Date: Thu, 2 Apr 2015 14:23:21 +0200 Subject: [PATCH] Add basic SSL functionality. --- apache/vhosts/standard.tmpl | 8 ++++++++ pillar.example | 3 +++ 2 files changed, 11 insertions(+) diff --git a/apache/vhosts/standard.tmpl b/apache/vhosts/standard.tmpl index 887a1a9..1464a91 100644 --- a/apache/vhosts/standard.tmpl +++ b/apache/vhosts/standard.tmpl @@ -48,6 +48,14 @@ {% if site.get('DocumentRoot') != False %}DocumentRoot {{ vals.DocumentRoot }}{% endif %} {% if site.get('VirtualDocumentRoot') %}VirtualDocumentRoot {{ vals.VirtualDocumentRoot }}{% endif %} + {% if site.SSLCertificateFile is defined %} + SSLEngine on + SSLCertificateFile {{ site.SSLCertificateFile }} + {% if site.SSLCertificateKeyFile is defined %} + SSLCertificateKeyFile {{ site.SSLCertificateKeyFile }} + {% endif %} + {% endif %} + {% for path, dir in site.get('Directory', {}).items() %} {% set dvals = { 'Options': dir.get('Options', vals.Directory.Options), diff --git a/pillar.example b/pillar.example index 65deac6..206d40f 100644 --- a/pillar.example +++ b/pillar.example @@ -44,6 +44,9 @@ apache: DocumentRoot: /path/to/www/dir/example.com # E.g., /var/www/example.com + SSLCertificateFile = /etc/ssl/mycert.pem # if ssl is desired + SSLCertificateKeyFile = /etc/ssl/mycert.pem.key # if key for cert is needed or in an extra file + Directory: # "default" is a special case; Adds ``/path/to/www/dir/example.com`` # E.g.: /var/www/example.com