Matrix Docker Ansible eploy
No puede seleccionar más de 25 temas Los temas deben comenzar con una letra o número, pueden incluir guiones ('-') y pueden tener hasta 35 caracteres de largo.
 
 

84 líneas
2.2 KiB

  1. ---
  2. #
  3. # Generic tasks that we always want to happen, regardless
  4. # if the user wants matrix-nginx-proxy or not.
  5. #
  6. # If the user would set up their own nginx proxy server,
  7. # the config files from matrix-nginx-proxy can be reused.
  8. #
  9. # It doesn't hurt to put them in place, even if they turn out
  10. # to be unnecessary.
  11. #
  12. - name: Ensure Matrix nginx-proxy paths exist
  13. file:
  14. path: "{{ item }}"
  15. state: directory
  16. mode: 0750
  17. owner: root
  18. group: root
  19. with_items:
  20. - "{{ matrix_nginx_proxy_data_path }}"
  21. - "{{ matrix_nginx_proxy_confd_path }}"
  22. - name: Ensure Matrix nginx-proxy configured
  23. template:
  24. src: "{{ role_path }}/templates/nginx-conf.d/{{ item }}.j2"
  25. dest: "{{ matrix_nginx_proxy_confd_path }}/{{ item }}"
  26. mode: 0644
  27. with_items:
  28. - "nginx-http.conf"
  29. - "matrix-synapse.conf"
  30. - "matrix-riot-web.conf"
  31. #
  32. # Tasks related to setting up matrix-nginx-proxy
  33. #
  34. - name: Ensure nginx Docker image is pulled
  35. docker_image:
  36. name: "{{ matrix_nginx_proxy_docker_image }}"
  37. when: matrix_nginx_proxy_enabled
  38. - name: Allow access to nginx proxy ports in firewalld
  39. firewalld:
  40. service: "{{ item }}"
  41. state: enabled
  42. immediate: yes
  43. permanent: yes
  44. with_items:
  45. - "http"
  46. - "https"
  47. when: "ansible_os_family == 'RedHat' and matrix_nginx_proxy_enabled"
  48. - name: Ensure matrix-nginx-proxy.service installed
  49. template:
  50. src: "{{ role_path }}/templates/systemd/matrix-nginx-proxy.service.j2"
  51. dest: "/etc/systemd/system/matrix-nginx-proxy.service"
  52. mode: 0644
  53. when: matrix_nginx_proxy_enabled
  54. #
  55. # Tasks related to getting rid of matrix-nginx-proxy (if it was previously enabled)
  56. #
  57. - name: Check existence of matrix-nginx-proxy service
  58. stat:
  59. path: "/etc/systemd/system/matrix-nginx-proxy.service"
  60. register: matrix_nginx_proxy_service_stat
  61. - name: Ensure matrix-nginx-proxy is stopped
  62. service:
  63. name: matrix-nginx-proxy
  64. state: stopped
  65. daemon_reload: yes
  66. register: stopping_result
  67. when: "not matrix_nginx_proxy_enabled and matrix_nginx_proxy_service_stat.stat.exists"
  68. - name: Ensure matrix-nginx-proxy.service doesn't exist
  69. file:
  70. path: "/etc/systemd/system/matrix-nginx-proxy.service"
  71. state: absent
  72. when: "not matrix_nginx_proxy_enabled and matrix_nginx_proxy_service_stat.stat.exists"