Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save lifeofguenter/f44bda368cb434211f20e046aceeb18c to your computer and use it in GitHub Desktop.

Select an option

Save lifeofguenter/f44bda368cb434211f20e046aceeb18c to your computer and use it in GitHub Desktop.
- name: Generate cert
ansible.builtin.command: >
certbot
certonly
--email={{ admin_addr_to }}
--agree-tos
--non-interactive
--expand
--key-type=ecdsa
--elliptic-curve=secp384r1
--webroot
--webroot-path=/var/www/letsencrypt/
--domain=foobar.com
args:
creates: /etc/letsencrypt/live/foobar.com/privkey.pem
become: true
- name: Add certbot reload-nginx hook
ansible.builtin.copy:
src: reload-nginx.sh
dest: /etc/letsencrypt/renewal-hooks/deploy/reload-nginx.sh
mode: "a+x"
become: true
when: www_cert_check.stat.exists
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment