No Description
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 2.4KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  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. notify: restart apache
  5. - name: Copy SSL public certificate into place
  6. copy: src=wildcard_public_cert.crt dest=/etc/ssl/certs/wildcard_public_cert.crt group=root owner=root mode=644
  7. register: certificate
  8. notify: restart apache
  9. - name: Copy CA combined certificate into place
  10. copy: src=wildcard_ca.pem dest=/etc/ssl/certs/wildcard_ca.pem group=root owner=root mode=644
  11. register: ca_certificate
  12. notify: restart apache
  13. - name: Create a combined version of the public cert with intermediate and root CAs
  14. shell: cat /etc/ssl/certs/wildcard_public_cert.crt /etc/ssl/certs/wildcard_ca.pem >
  15. /etc/ssl/certs/wildcard_combined.pem
  16. when: private_key.changed or certificate.changed or ca_certificate.changed
  17. - name: Set permissions on combined public cert
  18. file: name=/etc/ssl/certs/wildcard_combined.pem mode=644
  19. notify: restart apache
  20. - name: Create strong Diffie-Hellman group
  21. command: openssl dhparam -out /etc/ssl/private/dhparam2048.pem 2048
  22. creates=/etc/ssl/private/dhparam2048.pem
  23. - name: Enable Apache SSL module
  24. command: a2enmod ssl creates=/etc/apache2/mods-enabled/ssl.load
  25. notify: restart apache
  26. - name: Enable NameVirtualHost for HTTPS
  27. lineinfile:
  28. dest=/etc/apache2/ports.conf regexp='^ NameVirtualHost \*:443'
  29. insertafter='^<IfModule mod_ssl.c>'
  30. line=' NameVirtualHost *:443'
  31. notify: restart apache
  32. - name: Enable Apache SOCACHE_SHMCB module for the SSL stapling cache
  33. command: a2enmod socache_shmcb
  34. creates=/etc/apache2/mods-enabled/socache_shmcb.load
  35. notify: restart apache
  36. when: ansible_distribution_release != 'wheezy'
  37. - name: Add Apache SSL stapling cache configuration
  38. copy:
  39. src=etc_apache2_conf-available_ssl-stapling-cache.conf
  40. dest=/etc/apache2/conf-available/ssl-stapling-cache.conf
  41. owner=root
  42. group=root
  43. when: ansible_distribution_release != 'wheezy'
  44. notify: restart apache
  45. - name: Enable Apache SSL stapling cache configuration
  46. command: a2enconf ssl-stapling-cache
  47. creates=/etc/apache2/conf-enabled/ssl-stapling-cache.conf
  48. when: ansible_distribution_release != 'wheezy'
  49. notify: restart apache
  50. - name: Add common Apache SSL config
  51. template:
  52. src=etc_apache2_ssl.conf.j2
  53. dest=/etc/apache2/ssl.conf
  54. owner=root
  55. group=root
  56. notify: restart apache