Skip to content

Commit 6a16c08

Browse files
committed
Use default value when expr. evaluates to false
According to http://jinja.pocoo.org/docs/2.10/templates/#default > If you want to use default with variables that evaluate to false you > have to set the second parameter to true This is the only way to use the default value when passing None, since it evaluates to false.
1 parent 3eb9b64 commit 6a16c08

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

tasks/main.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616

1717
- name: Check if certificate already exists
1818
stat:
19-
path: "/etc/letsencrypt/live/{{ certbot_nginx_cert_name | default(domain_name) }}/cert.pem"
19+
path: "/etc/letsencrypt/live/{{ certbot_nginx_cert_name | default(domain_name, true) }}/cert.pem"
2020
register: letsencrypt_cert
2121

2222
- name: Generate new certificate if one doesn't exist

0 commit comments

Comments
 (0)