Matrix Docker Ansible eploy
Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.

77 строки
2.7 KiB

  1. # SPDX-FileCopyrightText: 2025 - 2026 MDAD project contributors
  2. # SPDX-FileCopyrightText: 2025 - 2026 Slavi Pantaleev
  3. #
  4. # SPDX-License-Identifier: AGPL-3.0-or-later
  5. ---
  6. - name: Ensure tuwunel config path exists
  7. ansible.builtin.file:
  8. path: "{{ matrix_tuwunel_config_path }}"
  9. state: directory
  10. mode: '0750'
  11. owner: "{{ matrix_user_name }}"
  12. group: "{{ matrix_group_name }}"
  13. - name: Ensure tuwunel data path exists
  14. ansible.builtin.file:
  15. path: "{{ matrix_tuwunel_data_path }}"
  16. state: directory
  17. mode: '0770'
  18. owner: "{{ matrix_user_name }}"
  19. group: "{{ matrix_group_name }}"
  20. - name: Ensure tuwunel configuration installed
  21. ansible.builtin.template:
  22. src: "{{ matrix_tuwunel_template_tuwunel_config }}"
  23. dest: "{{ matrix_tuwunel_config_path }}/tuwunel.toml"
  24. mode: '0644'
  25. owner: "{{ matrix_user_name }}"
  26. group: "{{ matrix_group_name }}"
  27. register: matrix_tuwunel_config_result
  28. - name: Ensure tuwunel support files installed
  29. ansible.builtin.template:
  30. src: "{{ role_path }}/templates/{{ item }}.j2"
  31. dest: "{{ matrix_tuwunel_base_path }}/{{ item }}"
  32. mode: '0640'
  33. owner: "{{ matrix_user_name }}"
  34. group: "{{ matrix_group_name }}"
  35. with_items:
  36. - labels
  37. - env
  38. register: matrix_tuwunel_support_files_result
  39. - name: Ensure tuwunel container network is created
  40. community.general.docker_network:
  41. enable_ipv6: "{{ devture_systemd_docker_base_ipv6_enabled }}"
  42. name: "{{ matrix_tuwunel_container_network }}"
  43. driver: bridge
  44. driver_options: "{{ devture_systemd_docker_base_container_networks_driver_options }}"
  45. - name: Ensure tuwunel container image is pulled
  46. community.docker.docker_image_pull:
  47. name: "{{ matrix_tuwunel_container_image }}"
  48. pull: always
  49. register: matrix_tuwunel_container_image_pull_result
  50. retries: "{{ devture_playbook_help_container_retries_count }}"
  51. delay: "{{ devture_playbook_help_container_retries_delay }}"
  52. until: matrix_tuwunel_container_image_pull_result is not failed
  53. - name: Ensure matrix-tuwunel.service installed
  54. ansible.builtin.template:
  55. src: "{{ role_path }}/templates/systemd/matrix-tuwunel.service.j2"
  56. dest: "{{ devture_systemd_docker_base_systemd_path }}/matrix-tuwunel.service"
  57. mode: '0644'
  58. register: matrix_tuwunel_systemd_service_result
  59. - name: Determine whether tuwunel needs a restart
  60. ansible.builtin.set_fact:
  61. matrix_tuwunel_restart_necessary: >-
  62. {{
  63. matrix_tuwunel_config_result.changed | default(false)
  64. or matrix_tuwunel_support_files_result.changed | default(false)
  65. or matrix_tuwunel_systemd_service_result.changed | default(false)
  66. or matrix_tuwunel_container_image_pull_result.changed | default(false)
  67. }}