Sin descripción
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

letsencrypt.yml 1.2KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. - name: Download LetsEncrypt release
  2. git: repo=https://github.com/letsencrypt/letsencrypt
  3. dest=/root/letsencrypt
  4. version=master
  5. - name: Create directory for LetsEncrypt configuration and certificates
  6. file: state=directory path=/etc/letsencrypt group=root owner=root
  7. - name: Configure LetsEncrypt
  8. template:
  9. src=etc_letsencrypt_cli.conf.j2
  10. dest=/etc/letsencrypt/cli.conf
  11. owner=root
  12. group=root
  13. - name: Install LetsEncrypt package dependencies
  14. command: /root/letsencrypt/letsencrypt-auto --help
  15. - name: Install crontab entry for LetsEncrypt
  16. copy:
  17. src=etc_cron-monthly_letsencrypt-renew
  18. dest=/etc/cron.monthly/letsencrypt-renew
  19. owner=root
  20. group=root
  21. mode=755
  22. - name: Create live directory for LetsEncrypt cron job
  23. file: state=directory path=/etc/letsencrypt/live group=root owner=root
  24. - name: Stop Apache
  25. service: name=apache2 state=stopped
  26. - name: Get an SSL certificate for {{ domain }}
  27. command: /root/letsencrypt/letsencrypt-auto certonly -c /etc/letsencrypt/cli.conf --domains {{ domain }},{{ subdomains }}
  28. args:
  29. creates: /etc/letsencrypt/live/{{ domain }}/privkey.pem
  30. - name: Start Apache
  31. service: name=apache2 state=started