.. and add the template
authorTollef Fog Heen <tfheen@err.no>
Tue, 10 Jan 2017 20:16:00 +0000 (21:16 +0100)
committerTollef Fog Heen <tfheen@err.no>
Tue, 10 Jan 2017 20:16:00 +0000 (21:16 +0100)
modules/ssl/templates/key-chained.erb [new file with mode: 0644]

diff --git a/modules/ssl/templates/key-chained.erb b/modules/ssl/templates/key-chained.erb
new file mode 100644 (file)
index 0000000..2fbace0
--- /dev/null
@@ -0,0 +1,25 @@
+<%=
+  out = ""
+  fn = "/etc/puppet/modules/ssl/files/keys/#{name}.crt"
+  if File.exist?(fn) then
+    out = File.read(fn)
+  else
+    fn = "/etc/puppet/modules/ssl/files/from-letsencrypt/#{name}.key"
+    out = File.read(fn)
+  end
+  out
+%>
+<%=
+  out = ""
+  fn = "/etc/puppet/modules/ssl/files/servicecerts/#{name}.crt"
+  if File.exist?(fn) then
+    out = File.read(fn)
+
+    chain = "/etc/puppet/modules/ssl/files/chains/#{name}.crt"
+    out += File.exist?(chain) ? ("\n" + File.read(chain)) : ''
+  else
+    fn = "/etc/puppet/modules/ssl/files/from-letsencrypt/#{name}.crt-chained"
+    out = File.read(fn)
+  end
+  out
+%>