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.
 
 

59 line
2.8 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 }}"
  9. state: directory
  10. mode: 0750
  11. owner: "{{ matrix_user_name }}"
  12. group: "{{ matrix_group_name }}"
  13. with_items:
  14. - "{{ matrix_synapse_reverse_proxy_companion_base_path }}"
  15. - "{{ matrix_synapse_reverse_proxy_companion_confd_path }}"
  16. - name: Ensure matrix-synapse-reverse-proxy-companion is configured
  17. ansible.builtin.template:
  18. src: "{{ item.src }}"
  19. dest: "{{ item.dest }}"
  20. owner: "{{ matrix_user_name }}"
  21. group: "{{ matrix_group_name }}"
  22. mode: 0644
  23. with_items:
  24. - src: "{{ role_path }}/templates/nginx/nginx.conf.j2"
  25. dest: "{{ matrix_synapse_reverse_proxy_companion_base_path }}/nginx.conf"
  26. - src: "{{ role_path }}/templates/nginx/conf.d/nginx-http.conf.j2"
  27. dest: "{{ matrix_synapse_reverse_proxy_companion_confd_path }}/nginx-http.conf"
  28. - src: "{{ role_path }}/templates/nginx/conf.d/matrix-synapse-reverse-proxy-companion.conf.j2"
  29. dest: "{{ matrix_synapse_reverse_proxy_companion_confd_path }}/matrix-synapse-reverse-proxy-companion.conf"
  30. - src: "{{ role_path }}/templates/labels.j2"
  31. dest: "{{ matrix_synapse_reverse_proxy_companion_base_path }}/labels"
  32. - name: Ensure matrix-synapse-reverse-proxy-companion nginx container image is pulled
  33. community.docker.docker_image:
  34. name: "{{ matrix_synapse_reverse_proxy_companion_container_image }}"
  35. source: "{{ 'pull' if ansible_version.major > 2 or ansible_version.minor > 7 else omit }}"
  36. force_source: "{{ matrix_synapse_reverse_proxy_companion_container_image_force_pull if ansible_version.major > 2 or ansible_version.minor >= 8 else omit }}"
  37. force: "{{ omit if ansible_version.major > 2 or ansible_version.minor >= 8 else matrix_synapse_reverse_proxy_companion_container_image_force_pull }}"
  38. register: result
  39. retries: "{{ devture_playbook_help_container_retries_count }}"
  40. delay: "{{ devture_playbook_help_container_retries_delay }}"
  41. until: result is not failed
  42. - name: Ensure matrix-synapse-reverse-proxy-companion container network is created
  43. community.general.docker_network:
  44. enable_ipv6: "{{ devture_systemd_docker_base_ipv6_enabled }}"
  45. name: "{{ matrix_synapse_reverse_proxy_companion_container_network }}"
  46. driver: bridge
  47. driver_options: "{{ devture_systemd_docker_base_container_networks_driver_options }}"
  48. - name: Ensure matrix-synapse-reverse-proxy-companion.service installed
  49. ansible.builtin.template:
  50. src: "{{ role_path }}/templates/systemd/matrix-synapse-reverse-proxy-companion.service.j2"
  51. dest: "{{ devture_systemd_docker_base_systemd_path }}/matrix-synapse-reverse-proxy-companion.service"
  52. mode: 0644