Matrix Docker Ansible eploy
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.
 
 

64 rivejä
2.1 KiB

  1. ---
  2. #
  3. # Tasks related to setting up Let's Encrypt's management of certificates
  4. #
  5. - debug: var="matrix_ssl_retrieval_method"
  6. - name: (Deprecation) Fail if using outdated configuration
  7. fail:
  8. msg: "You're using the `host_specific_matrix_ssl_support_email` variable, which has been superseded by `host_specific_matrix_ssl_lets_encrypt_support_email`. Please change your configuration to use the new name!"
  9. when: "matrix_ssl_retrieval_method == 'lets-encrypt' and host_specific_matrix_ssl_support_email is defined"
  10. - name: Allow access to HTTP/HTTPS in firewalld
  11. firewalld:
  12. service: "{{ item }}"
  13. state: enabled
  14. immediate: yes
  15. permanent: yes
  16. with_items:
  17. - http
  18. - https
  19. when: "matrix_ssl_retrieval_method == 'lets-encrypt' and ansible_os_family == 'RedHat'"
  20. - name: Ensure certbot Docker image is pulled
  21. docker_image:
  22. name: "{{ matrix_ssl_lets_encrypt_certbot_docker_image }}"
  23. when: "matrix_ssl_retrieval_method == 'lets-encrypt'"
  24. - name: Obtain certificates
  25. include_tasks: "tasks/setup/ssl/setup_ssl_lets_encrypt_obtain_for_domain.yml"
  26. with_items: "{{ domains_requiring_certificates }}"
  27. loop_control:
  28. loop_var: domain_name
  29. when: "matrix_ssl_retrieval_method == 'lets-encrypt'"
  30. - name: Ensure SSL renewal script installed
  31. template:
  32. src: "{{ role_path }}/templates/usr-local-bin/matrix-ssl-certificates-renew.j2"
  33. dest: "/usr/local/bin/matrix-ssl-certificates-renew"
  34. mode: 0750
  35. when: "matrix_ssl_retrieval_method == 'lets-encrypt'"
  36. - name: Ensure periodic SSL renewal cronjob configured
  37. template:
  38. src: "{{ role_path }}/templates/cron.d/matrix-ssl-certificate-renewal.j2"
  39. dest: "/etc/cron.d/matrix-ssl-certificate-renewal"
  40. mode: 0600
  41. when: "matrix_ssl_retrieval_method == 'lets-encrypt'"
  42. #
  43. # Tasks related to getting rid of Let's Encrypt's management of certificates
  44. #
  45. - name: Ensure Let's Encrypt SSL certificate management files removed
  46. file:
  47. path: "{{ item }}"
  48. state: absent
  49. with_items:
  50. - /usr/local/bin/matrix-ssl-certificates-renew
  51. - /etc/cron.d/matrix-ssl-certificate-renewal
  52. when: "matrix_ssl_retrieval_method != 'lets-encrypt'"