Matrix Docker Ansible eploy
Non puoi selezionare più di 25 argomenti Gli argomenti devono iniziare con una lettera o un numero, possono includere trattini ('-') e possono essere lunghi fino a 35 caratteri.
 
 

63 righe
2.5 KiB

  1. ---
  2. # This is a cleanup/migration task, because of to the new way we manage cronjobs (`cron` module) and the new script name.
  3. # This migration task can be removed some time in the future.
  4. - name: (Migration) Remove deprecated Let's Encrypt SSL certificate management files
  5. file:
  6. path: "{{ item }}"
  7. state: absent
  8. with_items:
  9. - "{{ matrix_local_bin_path }}/matrix-ssl-certificates-renew"
  10. - "{{ matrix_cron_path }}/matrix-ssl-certificate-renewal"
  11. - "{{ matrix_cron_path }}/matrix-nginx-proxy-periodic-restarter"
  12. #
  13. # Tasks related to setting up Let's Encrypt's management of certificates
  14. #
  15. - name: Ensure certbot Docker image is pulled
  16. docker_image:
  17. name: "{{ matrix_ssl_lets_encrypt_certbot_docker_image }}"
  18. source: "{{ 'pull' if ansible_version.major > 2 or ansible_version.minor > 7 else omit }}"
  19. force_source: "{{ matrix_ssl_lets_encrypt_certbot_docker_image_force_pull if ansible_version.major > 2 or ansible_version.minor >= 8 else omit }}"
  20. force: "{{ omit if ansible_version.major > 2 or ansible_version.minor >= 8 else matrix_ssl_lets_encrypt_certbot_docker_image_force_pull }}"
  21. when: "matrix_ssl_retrieval_method == 'lets-encrypt'"
  22. - name: Obtain Let's Encrypt certificates
  23. include_tasks: "{{ role_path }}/tasks/ssl/setup_ssl_lets_encrypt_obtain_for_domain.yml"
  24. with_items: "{{ matrix_ssl_domains_to_obtain_certificates_for }}"
  25. loop_control:
  26. loop_var: domain_name
  27. when: "matrix_ssl_retrieval_method == 'lets-encrypt'"
  28. - name: Ensure Let's Encrypt SSL renewal script installed
  29. template:
  30. src: "{{ role_path }}/templates/usr-local-bin/matrix-ssl-lets-encrypt-certificates-renew.j2"
  31. dest: "{{ matrix_local_bin_path }}/matrix-ssl-lets-encrypt-certificates-renew"
  32. mode: 0750
  33. when: "matrix_ssl_retrieval_method == 'lets-encrypt'"
  34. - name: Ensure periodic SSL renewal cronjob configured
  35. template:
  36. src: "{{ role_path }}/templates/cron.d/matrix-ssl-lets-encrypt.j2"
  37. dest: /etc/cron.d/matrix-ssl-lets-encrypt
  38. mode: 0644
  39. when: "matrix_ssl_retrieval_method == 'lets-encrypt'"
  40. #
  41. # Tasks related to getting rid of Let's Encrypt's management of certificates
  42. #
  43. - name: Ensure matrix-ssl-lets-encrypt-renew cronjob removed
  44. file:
  45. path: /etc/cron.d/matrix-ssl-lets-encrypt
  46. state: absent
  47. when: "matrix_ssl_retrieval_method != 'lets-encrypt'"
  48. - name: Ensure Let's Encrypt SSL renewal script removed
  49. file:
  50. path: "{{ matrix_local_bin_path }}/matrix-ssl-lets-encrypt-certificates-renew"
  51. state: absent
  52. when: "matrix_ssl_retrieval_method != 'lets-encrypt'"