Commit 355aa844 authored by Jérome Perrin's avatar Jérome Perrin

stack/caucase: generate key / csr only once

If key or csr are already present, we should not re-run this
openssl command which generates a new key and a new CSR.
parent 002e4185
......@@ -15,4 +15,4 @@
[caucase-jinja2-library]
filename = caucase.jinja2.library
md5sum = 2e7e61bb0cf41c28d6d811a0283cf03e
md5sum = a59dec6d2ecc1cc4dcd0292d571c79d8
......@@ -88,7 +88,10 @@ rendered = ${ {{- prefix }}-directory:data-dir}/provided.csr.pem
{%- else -%}
[{{ prefix }}-csr]
recipe = plone.recipe.command
command = '{{ openssl }}' req -newkey rsa:2048 -batch -new -nodes -subj /CN=example.com -keyout '{{ key_path or crt_path }}' -out '${:csr}'
command =
if [ ! -f '{{ key_path or crt_path }}' ] && [ ! -f '${:csr}' ] ; then
'{{ openssl }}' req -newkey rsa:2048 -batch -new -nodes -subj /CN=example.com -keyout '{{ key_path or crt_path }}' -out '${:csr}'
fi
{%- endif %}
csr = ${ {{- prefix }}-directory:data-dir}/good.csr.pem
{%- endif %}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment