mirror of
https://github.com/geerlingguy/ansible-role-certbot.git
synced 2025-04-19 00:41:38 +02:00
Improve certificate existence check by removing bashisms
This commit is contained in:
parent
95c899b215
commit
9c0d000138
@ -1,7 +1,6 @@
|
||||
---
|
||||
- name: Get installed certificates.
|
||||
shell: |
|
||||
{{ certbot_script }} certificates | grep "Domains:" | awk '{ gsub(/ Domains: /,""); print }'
|
||||
command: "{{ certbot_script }} certificates"
|
||||
changed_when: false
|
||||
register: letsencrypt_certs
|
||||
|
||||
@ -13,4 +12,4 @@
|
||||
set_fact:
|
||||
cert_exists: true
|
||||
when: cert_item.domains | sort | difference(item) == []
|
||||
with_list: "{{ letsencrypt_certs.stdout_lines }}"
|
||||
with_list: "{{ letsencrypt_certs.stdout_lines | select('match', '.*Domains:.*') | map('regex_replace', '^.*Domains: (.*)$', '\\1') }}"
|
||||
|
Loading…
x
Reference in New Issue
Block a user