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.1KB

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