Matrix Docker Ansible eploy
Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.
 
 

68 строки
2.9 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. ansible.builtin.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. - when: "matrix_ssl_retrieval_method == 'lets-encrypt'"
  17. block:
  18. - when: matrix_ssl_orphaned_renewal_configs_purging_enabled | bool
  19. ansible.builtin.import_tasks: "{{ role_path }}/tasks/ssl/purge_ssl_lets_encrypt_orphaned_configs.yml"
  20. - name: Ensure certbot Docker image is pulled
  21. docker_image:
  22. name: "{{ matrix_ssl_lets_encrypt_certbot_docker_image }}"
  23. source: "{{ 'pull' if ansible_version.major > 2 or ansible_version.minor > 7 else omit }}"
  24. force_source: "{{ matrix_ssl_lets_encrypt_certbot_docker_image_force_pull if ansible_version.major > 2 or ansible_version.minor >= 8 else omit }}"
  25. force: "{{ omit if ansible_version.major > 2 or ansible_version.minor >= 8 else matrix_ssl_lets_encrypt_certbot_docker_image_force_pull }}"
  26. - name: Obtain Let's Encrypt certificates
  27. ansible.builtin.include_tasks: "{{ role_path }}/tasks/ssl/setup_ssl_lets_encrypt_obtain_for_domain.yml"
  28. with_items: "{{ matrix_ssl_domains_to_obtain_certificates_for | unique }}"
  29. loop_control:
  30. loop_var: domain_name
  31. - name: Ensure Let's Encrypt SSL renewal script installed
  32. ansible.builtin.template:
  33. src: "{{ role_path }}/templates/usr-local-bin/matrix-ssl-lets-encrypt-certificates-renew.j2"
  34. dest: "{{ matrix_local_bin_path }}/matrix-ssl-lets-encrypt-certificates-renew"
  35. mode: 0755
  36. - name: Ensure SSL renewal systemd units installed
  37. ansible.builtin.template:
  38. src: "{{ role_path }}/templates/systemd/{{ item.name }}.j2"
  39. dest: "{{ matrix_systemd_path }}/{{ item.name }}"
  40. mode: 0644
  41. when: "item.applicable | bool"
  42. with_items: "{{ matrix_ssl_renewal_systemd_units_list }}"
  43. #
  44. # Tasks related to getting rid of Let's Encrypt's management of certificates
  45. #
  46. - when: "matrix_ssl_retrieval_method != 'lets-encrypt'"
  47. block:
  48. - name: Ensure matrix-ssl-lets-encrypt-renew cronjob removed
  49. ansible.builtin.file:
  50. path: "{{ matrix_systemd_path }}/{{ item.name }}"
  51. state: absent
  52. when: "not item.applicable | bool"
  53. with_items: "{{ matrix_ssl_renewal_systemd_units_list }}"
  54. - name: Ensure Let's Encrypt SSL renewal script removed
  55. ansible.builtin.file:
  56. path: "{{ matrix_local_bin_path }}/matrix-ssl-lets-encrypt-certificates-renew"
  57. state: absent