fixed some bugs
This commit is contained in:
parent
ff1cfedadf
commit
313452f5e2
4 changed files with 12 additions and 5 deletions
|
|
@ -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
|
||||
|
||||
|
|
|
|||
|
|
@ -12,6 +12,7 @@
|
|||
fullchain_dest: "{{ cert.chainpath }}"
|
||||
remaining_days: "{{ certificates.backends.letsencrypt.remainingdays }}"
|
||||
challenge: "{{ certificates.backends.letsencrypt.challange }}"
|
||||
deactivate_authzs: yes
|
||||
register: challenge
|
||||
|
||||
- name: "setup challenge server for {{ certname }} (dns challange)"
|
||||
|
|
@ -27,8 +28,14 @@
|
|||
- "{{ challenge.challenge_data[item.1]['dns-01'].resource_value }}"
|
||||
|
||||
- name: "setup challenge server for {{ certname }} (http challange)"
|
||||
debug: msg=a
|
||||
|
||||
when:
|
||||
- challenge is changed
|
||||
- certificates.backends.letsencrypt.challange == "http-01"
|
||||
delegate_to: "{{ item.0 }}"
|
||||
loop: "{{ certificates.backends.letsencrypt.challangeserver|product(challenge.challenge_data.keys()|list)|list }}"
|
||||
copy:
|
||||
dest: "/var/www/letsencrypt/{{ challenge.challenge_data[item.1]['http-01'].resource | basename }}"
|
||||
content: "{{ challenge.challenge_data.[item.1]['http-01'].resource_value }}"
|
||||
|
||||
- name: "get certificate {{ certname }}"
|
||||
acme_certificate:
|
||||
|
|
|
|||
|
|
@ -2,7 +2,6 @@
|
|||
apt:
|
||||
pkg:
|
||||
- openssl
|
||||
- python3-openssl
|
||||
- python3-cryptography
|
||||
|
||||
- name: add group ssl-cert
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue