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.
 
 

97 rivejä
3.3 KiB

  1. ---
  2. #
  3. # Tasks related to setting up jitsi-jicofo
  4. #
  5. - name: Ensure Matrix jitsi-jicofo path exists
  6. file:
  7. path: "{{ item.path }}"
  8. state: directory
  9. mode: 0777
  10. owner: "{{ matrix_user_username }}"
  11. group: "{{ matrix_user_groupname }}"
  12. with_items:
  13. - { path: "{{ matrix_jitsi_jicofo_base_path }}", when: true }
  14. - { path: "{{ matrix_jitsi_jicofo_config_path }}", when: true }
  15. when: matrix_jitsi_enabled|bool and item.when
  16. - name: Ensure jitsi-jicofo Docker image is pulled
  17. docker_image:
  18. name: "{{ matrix_jitsi_jicofo_docker_image }}"
  19. source: "{{ 'pull' if ansible_version.major > 2 or ansible_version.minor > 7 else omit }}"
  20. force_source: "{{ matrix_jitsi_jicofo_docker_image_force_pull if ansible_version.major > 2 or ansible_version.minor >= 8 else omit }}"
  21. force: "{{ omit if ansible_version.major > 2 or ansible_version.minor >= 8 else matrix_jitsi_jicofo_docker_image_force_pull }}"
  22. when: matrix_jitsi_enabled|bool
  23. - name: Ensure jitsi-jicofo environment variables file created
  24. template:
  25. src: "{{ role_path }}/templates/jicofo/env.j2"
  26. dest: "{{ matrix_jitsi_jicofo_base_path }}/env"
  27. mode: 0640
  28. when: matrix_jitsi_enabled|bool
  29. - name: Ensure jitsi-jicofo configuration files created
  30. template:
  31. src: "{{ role_path }}/templates/jicofo/{{ item }}.j2"
  32. dest: "{{ matrix_jitsi_jicofo_config_path }}/{{ item }}"
  33. mode: 0644
  34. with_items:
  35. - sip-communicator.properties
  36. - logging.properties
  37. when: matrix_jitsi_enabled|bool
  38. - name: Ensure matrix-jitsi-jicofo.service installed
  39. template:
  40. src: "{{ role_path }}/templates/jicofo/matrix-jitsi-jicofo.service.j2"
  41. dest: "{{ matrix_systemd_path }}/matrix-jitsi-jicofo.service"
  42. mode: 0644
  43. register: matrix_jitsi_jicofo_systemd_service_result
  44. when: matrix_jitsi_enabled|bool
  45. - name: Ensure systemd reloaded after matrix-jitsi-jicofo.service installation
  46. service:
  47. daemon_reload: yes
  48. when: "matrix_jitsi_enabled and matrix_jitsi_jicofo_systemd_service_result.changed"
  49. #
  50. # Tasks related to getting rid of jitsi-jicofo (if it was previously enabled)
  51. #
  52. - name: Check existence of matrix-jitsi-jicofo service
  53. stat:
  54. path: "{{ matrix_systemd_path }}/matrix-jitsi-jicofo.service"
  55. register: matrix_jitsi_jicofo_service_stat
  56. when: "not matrix_jitsi_enabled|bool"
  57. - name: Ensure matrix-jitsi-jicofo is stopped
  58. service:
  59. name: matrix-jitsi-jicofo
  60. state: stopped
  61. daemon_reload: yes
  62. register: stopping_result
  63. when: "not matrix_jitsi_enabled|bool and matrix_jitsi_jicofo_service_stat.stat.exists"
  64. - name: Ensure matrix-jitsi-jicofo.service doesn't exist
  65. file:
  66. path: "{{ matrix_systemd_path }}/matrix-jitsi-jicofo.service"
  67. state: absent
  68. when: "not matrix_jitsi_enabled|bool and matrix_jitsi_jicofo_service_stat.stat.exists"
  69. - name: Ensure systemd reloaded after matrix-jitsi-jicofo.service removal
  70. service:
  71. daemon_reload: yes
  72. when: "not matrix_jitsi_enabled|bool and matrix_jitsi_jicofo_service_stat.stat.exists"
  73. - name: Ensure Matrix jitsi-jicofo paths doesn't exist
  74. file:
  75. path: "{{ matrix_jitsi_jicofo_base_path }}"
  76. state: absent
  77. when: "not matrix_jitsi_enabled|bool"
  78. - name: Ensure jitsi-jicofo Docker image doesn't exist
  79. docker_image:
  80. name: "{{ matrix_jitsi_jicofo_docker_image }}"
  81. state: absent
  82. when: "not matrix_jitsi_enabled|bool"