caktus / margarita

A collection of delicious Salt states for Django project deployments.
BSD 3-Clause "New" or "Revised" License
34 stars 8 forks source link

Letsencrypt update fails if list of domain names changes #160

Open dpoirier opened 6 years ago

dpoirier commented 6 years ago

This fixed it for one project:


@@ -198,7 +198,7 @@ verify_certbot_download:
 # Run certbot to get a key and certificate
 run_certbot:
   cmd.run:
-    - name: certbot-auto certonly --webroot --webroot-path {{ vars.public_dir }} {% for domain in letsencrypt_domains %}--domain {{ domain }} {% endfor %} --email={{ pillar['admin_email'] }} --agree-tos --text --quiet --no-self-upgrade
+    - name: certbot-auto certonly --webroot --webroot-path {{ vars.public_dir }} {% for domain in letsencrypt_domains %}--domain {{ domain }} {% endfor %} --email={{ pillar['admin_email'] }} --agree-tos --text --quiet --no-self-upgrade --expand
     - unless: test -s /etc/letsencrypt/live/{{ pillar['domain'] }}/fullchain.pem -a -s /etc/letsencrypt/live/{{ pillar['domain'] }}/privkey.pem
     - require:
       - file: install_certbot```