暫無描述
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.

ssl.yml 1.3KB

1234567891011121314151617181920212223242526272829303132333435
  1. - name: Copy SSL private key into place
  2. copy: src=wildcard_private.key dest=/etc/ssl/private/wildcard_private.key group=ssl-cert owner=root mode=640
  3. register: private_key
  4. - name: Copy SSL public certificate into place
  5. copy: src=wildcard_public_cert.crt dest=/etc/ssl/certs/wildcard_public_cert.crt group=root owner=root mode=644
  6. register: certificate
  7. - name: Copy CA combined certificate into place
  8. copy: src=wildcard_ca.pem dest=/etc/ssl/certs/wildcard_ca.pem group=root owner=root mode=644
  9. register: ca_certificate
  10. - name: Create a combined version of the public cert with intermediate and root CAs
  11. shell: cat /etc/ssl/certs/wildcard_public_cert.crt /etc/ssl/certs/wildcard_ca.pem >
  12. /etc/ssl/certs/wildcard_combined.pem
  13. when: private_key.changed or certificate.changed or ca_certificate.changed
  14. - name: Set permissions on combined public cert
  15. file: name=/etc/ssl/certs/wildcard_combined.pem mode=644
  16. - name: Enable Apache SSL module
  17. command: a2enmod ssl creates=/etc/apache2/mods-enabled/ssl.load
  18. - name: Enable NameVirtualHost for HTTPS
  19. lineinfile:
  20. dest=/etc/apache2/ports.conf regexp='^ NameVirtualHost \*:443'
  21. insertafter='^<IfModule mod_ssl.c>'
  22. line=' NameVirtualHost *:443'
  23. - name: Add common Apache SSL config
  24. template:
  25. src=etc_apache2_ssl.conf.j2
  26. dest=/etc/apache2/ssl.conf
  27. owner=root
  28. group=root