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.
 
 

86 regels
3.7 KiB

  1. ---
  2. - name: Ensure Matrix jitsi-prosody environment exists
  3. ansible.builtin.file:
  4. path: "{{ item.path }}"
  5. state: directory
  6. mode: 0777
  7. owner: "{{ matrix_user_username }}"
  8. group: "{{ matrix_user_groupname }}"
  9. with_items:
  10. - {path: "{{ matrix_jitsi_prosody_base_path }}", when: true}
  11. - {path: "{{ matrix_jitsi_prosody_config_path }}", when: true}
  12. - {path: "{{ matrix_jitsi_prosody_plugins_path }}", when: true}
  13. - {path: "{{ matrix_jitsi_prosody_ext_path }}", when: true}
  14. when: item.when | bool
  15. - name: Ensure jitsi-prosody Docker image is pulled
  16. community.docker.docker_image:
  17. name: "{{ matrix_jitsi_prosody_docker_image }}"
  18. source: "{{ 'pull' if ansible_version.major > 2 or ansible_version.minor > 7 else omit }}"
  19. force_source: "{{ matrix_jitsi_prosody_docker_image_force_pull if ansible_version.major > 2 or ansible_version.minor >= 8 else omit }}"
  20. force: "{{ omit if ansible_version.major > 2 or ansible_version.minor >= 8 else matrix_jitsi_prosody_docker_image_force_pull }}"
  21. register: result
  22. retries: "{{ devture_playbook_help_container_retries_count }}"
  23. delay: "{{ devture_playbook_help_container_retries_delay }}"
  24. until: result is not failed
  25. - name: Ensure jitsi-prosody environment variables file is created
  26. ansible.builtin.template:
  27. src: "{{ role_path }}/templates/prosody/env.j2"
  28. dest: "{{ matrix_jitsi_prosody_base_path }}/env"
  29. owner: "{{ matrix_user_username }}"
  30. group: "{{ matrix_user_groupname }}"
  31. mode: 0640
  32. # Configure matrix authentication.
  33. - name: Install user verification plugin
  34. ansible.builtin.include_tasks:
  35. file: "{{ role_path }}/tasks/util/setup_jitsi_auth_uvs_install.yml"
  36. when: matrix_jitsi_enable_auth | bool and matrix_jitsi_auth_type == "matrix"
  37. - name: Manage Jitsi .well-known
  38. when: matrix_jitsi_require_well_known | bool
  39. block:
  40. - name: Ensure .well-known directories exist
  41. ansible.builtin.file:
  42. path: "{{ item.path }}"
  43. state: directory
  44. mode: 0775
  45. owner: "{{ matrix_user_username }}"
  46. group: "{{ matrix_user_groupname }}"
  47. with_items:
  48. - {path: "{{ matrix_static_files_base_path }}/.well-known/element", when: "{{ matrix_jitsi_enable_auth | bool and matrix_jitsi_auth_type == 'matrix' }}"}
  49. when: item.when | bool
  50. # Create .well-known/element/jitsi in the static file directory for nginx-proxy.
  51. - name: Ensure Jitsi /.well-known/element/jitsi configured
  52. ansible.builtin.copy:
  53. content: "{{ matrix_jitsi_wellknown_element_jitsi_json }}"
  54. dest: "{{ matrix_static_files_base_path }}/.well-known/element/jitsi"
  55. mode: 0644
  56. owner: "{{ matrix_user_username }}"
  57. group: "{{ matrix_user_groupname }}"
  58. when: matrix_jitsi_enable_auth | bool and matrix_jitsi_auth_type == "matrix"
  59. # END Block
  60. # Remove matrix authentication if disabled
  61. - name: Ensure user verification plugin is not present if matrix auth is disabled
  62. ansible.builtin.include_tasks:
  63. file: "{{ role_path }}/tasks/util/setup_jitsi_auth_uvs_uninstall.yml"
  64. when: (not matrix_jitsi_enable_auth | bool) or (matrix_jitsi_auth_type != "matrix")
  65. - name: Ensure matrix-jitsi-prosody.service file is installed
  66. ansible.builtin.template:
  67. src: "{{ role_path }}/templates/prosody/matrix-jitsi-prosody.service.j2"
  68. dest: "{{ devture_systemd_docker_base_systemd_path }}/matrix-jitsi-prosody.service"
  69. mode: 0644
  70. register: matrix_jitsi_prosody_systemd_service_result
  71. # Tasks that require a running prosody container are called in this file.
  72. - name: Run prosody related tasks, that require a running container.
  73. ansible.builtin.include_tasks:
  74. file: "{{ role_path }}/tasks/util/setup_jitsi_prosody_post_setup_hooks.yml"
  75. when:
  76. - matrix_jitsi_enable_auth | bool and matrix_jitsi_auth_type == "internal"