Page Menu
Home
DevCentral
Search
Configure Global Search
Log In
Files
F3744504
D694.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Referenced Files
None
Subscribers
None
D694.diff
View Options
diff --git a/roles/mailserver/certificates/files/update-smtp-certificates b/roles/mailserver/certificates/files/update-smtp-certificates
new file mode 100755
--- /dev/null
+++ b/roles/mailserver/certificates/files/update-smtp-certificates
@@ -0,0 +1,22 @@
+#!/bin/sh
+
+# -------------------------------------------------------------
+# Deploy mail certificate to SMTP server
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+# Project: Nasqueron
+# Created: 2016-11-03
+# License: Trivial work, not eligible to copyright
+# -------------------------------------------------------------
+
+: ${CONTAINER_NAME='mailserver'}
+: ${CERT_DIR='/data/letsencrypt/etc/live/mail.nasqueron.org-0001'}
+: ${CONTAINER_DIR="/var/lib/lxc/$CONTAINER_NAME/rootfs"}
+
+cp $CERT_DIR/fullchain.pem $CONTAINER_DIR/etc/ssl/certs/mailserver.crt
+cp $CERT_DIR/privkey.pem $CONTAINER_DIR/etc/ssl/private/mailserver.key
+
+# postfix runs as root
+chown 0:0 $CONTAINER_DIR/etc/ssl/private/mailserver.key
+chmod 400 $CONTAINER_DIR/etc/ssl/private/mailserver.key
+
+lxc-attach -n $CONTAINER_NAME -- service postfix restart
diff --git a/roles/mailserver/certificates/init.sls b/roles/mailserver/certificates/init.sls
new file mode 100644
--- /dev/null
+++ b/roles/mailserver/certificates/init.sls
@@ -0,0 +1,12 @@
+# -------------------------------------------------------------
+# Salt — Deploy SSL certificate for SMTP server
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+# Project: Nasqueron
+# Created: 2016-11-03
+# License: Trivial work, not eligible to copyright
+# -------------------------------------------------------------
+
+smtp_certificates_update_script:
+ file.managed:
+ - name: /usr/local/bin/update-smtp-certificates
+ - source: salt://roles/mailserver/certificates/files/update-smtp-certificates
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sat, Nov 16, 06:23 (22 h, 3 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2247176
Default Alt Text
D694.diff (1 KB)
Attached To
Mode
D694: Allow to update SMTP server certificates
Attached
Detach File
Event Timeline
Log In to Comment