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.
 
 

55 lines
1.6 KiB

  1. ---
  2. - name: Determine domains to obtain certificates for (Matrix)
  3. set_fact:
  4. domains_to_obtain_certificate_for: "['{{ hostname_matrix }}']"
  5. - name: Determine domains to obtain certificates for (Riot)
  6. set_fact:
  7. domains_to_obtain_certificate_for: "{{ domains_to_obtain_certificate_for + [hostname_riot] }}"
  8. when: matrix_riot_web_enabled
  9. - name: Allow access to HTTP/HTTPS in firewalld
  10. firewalld:
  11. service: "{{ item }}"
  12. state: enabled
  13. immediate: yes
  14. permanent: yes
  15. with_items:
  16. - http
  17. - https
  18. when: ansible_os_family == 'RedHat'
  19. - name: Ensure certbot Docker image is pulled
  20. docker_image:
  21. name: "{{ matrix_ssl_certbot_docker_image }}"
  22. - name: Ensure SSL certificate paths exists
  23. file:
  24. path: "{{ item }}"
  25. state: directory
  26. mode: 0770
  27. owner: "{{ matrix_user_username }}"
  28. group: "{{ matrix_user_username }}"
  29. with_items:
  30. - "{{ matrix_ssl_log_dir_path }}"
  31. - "{{ matrix_ssl_config_dir_path }}"
  32. - name: Obtain initial certificates
  33. include_tasks: "tasks/setup/setup_ssl_for_domain.yml"
  34. with_items: "{{ domains_to_obtain_certificate_for }}"
  35. loop_control:
  36. loop_var: domain_name
  37. - name: Ensure SSL renewal script installed
  38. template:
  39. src: "{{ role_path }}/templates/usr-local-bin/matrix-ssl-certificates-renew.j2"
  40. dest: "/usr/local/bin/matrix-ssl-certificates-renew"
  41. mode: 0750
  42. - name: Ensure periodic SSL renewal cronjob configured
  43. template:
  44. src: "{{ role_path }}/templates/cron.d/matrix-ssl-certificate-renewal.j2"
  45. dest: "/etc/cron.d/matrix-ssl-certificate-renewal"
  46. mode: 0600