Matrix Docker Ansible eploy
Você não pode selecionar mais de 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.
 
 

76 linhas
3.7 KiB

  1. # SPDX-FileCopyrightText: 2022 - 2024 Slavi Pantaleev
  2. # SPDX-FileCopyrightText: 2024 David Mehren
  3. #
  4. # SPDX-License-Identifier: AGPL-3.0-or-later
  5. ---
  6. - name: Ensure matrix-synapse-reverse-proxy-companion paths exist
  7. ansible.builtin.file:
  8. path: "{{ item.path }}"
  9. state: directory
  10. mode: 0750
  11. owner: "{{ matrix_user_name }}"
  12. group: "{{ matrix_group_name }}"
  13. with_items:
  14. - {path: "{{ matrix_synapse_reverse_proxy_companion_base_path }}", when: true}
  15. - {path: "{{ matrix_synapse_reverse_proxy_companion_confd_path }}", when: true}
  16. - {path: "{{ matrix_synapse_reverse_proxy_companion_njs_path }}", when: "{{ matrix_synapse_reverse_proxy_companion_njs_enabled }}"}
  17. when: item.when | bool
  18. - name: Ensure matrix-synapse-reverse-proxy-companion is configured
  19. ansible.builtin.template:
  20. src: "{{ item.src }}"
  21. dest: "{{ item.dest }}"
  22. owner: "{{ matrix_user_name }}"
  23. group: "{{ matrix_group_name }}"
  24. mode: 0644
  25. with_items:
  26. - src: "{{ role_path }}/templates/nginx/nginx.conf.j2"
  27. dest: "{{ matrix_synapse_reverse_proxy_companion_base_path }}/nginx.conf"
  28. - src: "{{ role_path }}/templates/nginx/conf.d/nginx-http.conf.j2"
  29. dest: "{{ matrix_synapse_reverse_proxy_companion_confd_path }}/nginx-http.conf"
  30. - src: "{{ role_path }}/templates/nginx/conf.d/matrix-synapse-reverse-proxy-companion.conf.j2"
  31. dest: "{{ matrix_synapse_reverse_proxy_companion_confd_path }}/matrix-synapse-reverse-proxy-companion.conf"
  32. - src: "{{ role_path }}/templates/labels.j2"
  33. dest: "{{ matrix_synapse_reverse_proxy_companion_base_path }}/labels"
  34. - name: Ensure matrix-synapse-reverse-proxy-companion whoami sync worker router njs script is deployed
  35. ansible.builtin.template:
  36. src: "{{ role_path }}/templates/nginx/njs/whoami_sync_worker_router.js.j2"
  37. dest: "{{ matrix_synapse_reverse_proxy_companion_njs_path }}/whoami_sync_worker_router.js"
  38. owner: "{{ matrix_user_name }}"
  39. group: "{{ matrix_group_name }}"
  40. mode: 0644
  41. when: matrix_synapse_reverse_proxy_companion_whoami_sync_worker_router_enabled | bool
  42. - name: Ensure matrix-synapse-reverse-proxy-companion njs path is removed when njs is disabled
  43. ansible.builtin.file:
  44. path: "{{ matrix_synapse_reverse_proxy_companion_njs_path }}"
  45. state: absent
  46. when: not matrix_synapse_reverse_proxy_companion_njs_enabled
  47. - name: Ensure matrix-synapse-reverse-proxy-companion nginx container image is pulled
  48. community.docker.docker_image:
  49. name: "{{ matrix_synapse_reverse_proxy_companion_container_image }}"
  50. source: "{{ 'pull' if ansible_version.major > 2 or ansible_version.minor > 7 else omit }}"
  51. force_source: "{{ matrix_synapse_reverse_proxy_companion_container_image_force_pull if ansible_version.major > 2 or ansible_version.minor >= 8 else omit }}"
  52. force: "{{ omit if ansible_version.major > 2 or ansible_version.minor >= 8 else matrix_synapse_reverse_proxy_companion_container_image_force_pull }}"
  53. register: result
  54. retries: "{{ devture_playbook_help_container_retries_count }}"
  55. delay: "{{ devture_playbook_help_container_retries_delay }}"
  56. until: result is not failed
  57. - name: Ensure matrix-synapse-reverse-proxy-companion container network is created
  58. community.general.docker_network:
  59. enable_ipv6: "{{ devture_systemd_docker_base_ipv6_enabled }}"
  60. name: "{{ matrix_synapse_reverse_proxy_companion_container_network }}"
  61. driver: bridge
  62. driver_options: "{{ devture_systemd_docker_base_container_networks_driver_options }}"
  63. - name: Ensure matrix-synapse-reverse-proxy-companion.service installed
  64. ansible.builtin.template:
  65. src: "{{ role_path }}/templates/systemd/matrix-synapse-reverse-proxy-companion.service.j2"
  66. dest: "{{ devture_systemd_docker_base_systemd_path }}/matrix-synapse-reverse-proxy-companion.service"
  67. mode: 0644