Matrix Docker Ansible eploy
Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.
 
 

65 lignes
2.7 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. - "/etc/cron.d/matrix-ssl-lets-encrypt"
  13. #
  14. # Tasks related to setting up Let's Encrypt's management of certificates
  15. #
  16. - block:
  17. - name: Ensure certbot Docker image is pulled
  18. docker_image:
  19. name: "{{ matrix_ssl_lets_encrypt_certbot_docker_image }}"
  20. source: "{{ 'pull' if ansible_version.major > 2 or ansible_version.minor > 7 else omit }}"
  21. force_source: "{{ matrix_ssl_lets_encrypt_certbot_docker_image_force_pull if ansible_version.major > 2 or ansible_version.minor >= 8 else omit }}"
  22. force: "{{ omit if ansible_version.major > 2 or ansible_version.minor >= 8 else matrix_ssl_lets_encrypt_certbot_docker_image_force_pull }}"
  23. - name: Obtain Let's Encrypt certificates
  24. include_tasks: "{{ role_path }}/tasks/ssl/setup_ssl_lets_encrypt_obtain_for_domain.yml"
  25. with_items: "{{ matrix_ssl_domains_to_obtain_certificates_for }}"
  26. loop_control:
  27. loop_var: domain_name
  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. - name: Ensure SSL renewal systemd units installed
  34. template:
  35. src: "{{ role_path }}/templates/systemd/{{ item.name }}.j2"
  36. dest: "{{ matrix_systemd_path }}/{{ item.name }}"
  37. mode: 0644
  38. when: "item.applicable|bool"
  39. with_items: "{{ matrix_ssl_renewal_systemd_units_list }}"
  40. when: "matrix_ssl_retrieval_method == 'lets-encrypt'"
  41. #
  42. # Tasks related to getting rid of Let's Encrypt's management of certificates
  43. #
  44. - block:
  45. - name: Ensure matrix-ssl-lets-encrypt-renew cronjob removed
  46. file:
  47. path: "{{ matrix_systemd_path }}/{{ item.name }}"
  48. state: absent
  49. when: "not item.applicable|bool"
  50. with_items: "{{ matrix_ssl_renewal_systemd_units_list }}"
  51. - name: Ensure Let's Encrypt SSL renewal script removed
  52. file:
  53. path: "{{ matrix_local_bin_path }}/matrix-ssl-lets-encrypt-certificates-renew"
  54. state: absent
  55. when: "matrix_ssl_retrieval_method != 'lets-encrypt'"