Nenhuma descrição
Você não pode selecionar mais de 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.

ssl.yml 2.0KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  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 common Apache SSL config
  38. copy: src=etc_apache2_conf-available_ssl.conf
  39. dest=/etc/apache2/conf-available/ssl.conf
  40. owner=root
  41. group=root
  42. notify: restart apache
  43. - name: Enable Apache SSL config
  44. command: a2enconf ssl creates=/etc/apache2/conf-enabled/ssl.conf
  45. notify: restart apache