fixed some bugs

This commit is contained in:
nd 2019-11-01 15:59:04 +01:00
parent ff1cfedadf
commit 313452f5e2
No known key found for this signature in database
GPG key ID: 21B5CD4DEE3670E9
4 changed files with 12 additions and 5 deletions

View file

@ -8,7 +8,7 @@
chainpath: "{{ basepath + '/' + certname + '.chain.crt' }}"
fullpath: "{{ basepath + '/private/' + certname + '.complete.pem' }}"
- set_fact:
cert: "{{ certificates.defaults|combine(cert_paths, certificates.certs[certname]|d({}), {'name': certname} ) }}"
cert: "{{ {}|combine(certificates.defaults, cert_paths, certificates.certs[certname]|d({}), {'name': certname} ) }}"
- debug:
verbosity: 1
@ -27,7 +27,7 @@
openssl_csr:
path: "{{ cert.csrpath }}"
privatekey_path: "{{ cert.keypath }}"
common_name: "{% if cert.cn %}{{ cert.cn }}{% else %}{{ cert.san[0] }}{% endif %}"
common_name: "{% if cert.cn %}{{ cert.cn }}{% elif cert.san|length > 0 %}{{ cert.san[0] }}{% else %}{{ cert.name }}{% endif %}"
subject_alt_name: "{{ cert.san | map('regex_replace', '^', 'DNS:') | list }}"
register: task_generate_csr