Matrix Docker Ansible eploy
25'ten fazla konu seçemezsiniz Konular bir harf veya rakamla başlamalı, kısa çizgiler ('-') içerebilir ve en fazla 35 karakter uzunluğunda olabilir.
 
 

77 satır
3.4 KiB

  1. # SPDX-FileCopyrightText: 2025 Nikita Chernyi
  2. #
  3. # SPDX-License-Identifier: AGPL-3.0-or-later
  4. ---
  5. - name: Ensure FluffyChat Web paths exists
  6. ansible.builtin.file:
  7. path: "{{ item.path }}"
  8. state: directory
  9. mode: 0750
  10. owner: "{{ matrix_user_name }}"
  11. group: "{{ matrix_group_name }}"
  12. with_items:
  13. - {path: "{{ matrix_client_fluffychat_base_path }}", when: true}
  14. - {path: "{{ matrix_client_fluffychat_config_path }}", when: true}
  15. - {path: "{{ matrix_client_fluffychat_container_src_files_path }}", when: "{{ matrix_client_fluffychat_container_image_self_build }}"}
  16. when: "item.when | bool"
  17. - name: Ensure FluffyChat Web container image is pulled
  18. community.docker.docker_image:
  19. name: "{{ matrix_client_fluffychat_docker_image }}"
  20. source: "{{ 'pull' if ansible_version.major > 2 or ansible_version.minor > 7 else omit }}"
  21. force_source: "{{ matrix_client_fluffychat_docker_image_force_pull if ansible_version.major > 2 or ansible_version.minor >= 8 else omit }}"
  22. force: "{{ omit if ansible_version.major > 2 or ansible_version.minor >= 8 else matrix_client_fluffychat_docker_image_force_pull }}"
  23. when: "not matrix_client_fluffychat_container_image_self_build | bool"
  24. register: result
  25. retries: "{{ devture_playbook_help_container_retries_count }}"
  26. delay: "{{ devture_playbook_help_container_retries_delay }}"
  27. until: result is not failed
  28. - when: "matrix_client_fluffychat_container_image_self_build | bool"
  29. block:
  30. - name: Ensure FluffyChat Web repository is present on self-build
  31. ansible.builtin.git:
  32. repo: "{{ matrix_client_fluffychat_container_image_self_build_repo }}"
  33. dest: "{{ matrix_client_fluffychat_container_src_files_path }}"
  34. version: "{{ matrix_client_fluffychat_container_image_self_build_version }}"
  35. force: "yes"
  36. become: true
  37. become_user: "{{ matrix_user_name }}"
  38. register: matrix_client_fluffychat_git_pull_results
  39. - name: Ensure FluffyChat Web container image is built
  40. ansible.builtin.command:
  41. cmd: |-
  42. {{ devture_systemd_docker_base_host_command_docker }} buildx build
  43. --tag={{ matrix_client_fluffychat_docker_image }}
  44. --file={{ matrix_client_fluffychat_container_src_files_path }}/Dockerfile
  45. {{ matrix_client_fluffychat_container_src_files_path }}
  46. changed_when: true
  47. - name: Ensure FluffyChat Web config files installed
  48. ansible.builtin.template:
  49. src: "{{ item.src }}"
  50. dest: "{{ item.dest }}"
  51. mode: 0644
  52. owner: "{{ matrix_user_name }}"
  53. group: "{{ matrix_group_name }}"
  54. with_items:
  55. - {src: "{{ role_path }}/templates/labels.j2", dest: "{{ matrix_client_fluffychat_base_path }}/labels"}
  56. - {src: "{{ role_path }}/templates/config.json.j2", dest: "{{ matrix_client_fluffychat_config_path }}/config.json"}
  57. when: "item.src is not none"
  58. - name: Ensure FluffyChat Web container network is created
  59. community.general.docker_network:
  60. enable_ipv6: "{{ devture_systemd_docker_base_ipv6_enabled }}"
  61. name: "{{ matrix_client_fluffychat_container_network }}"
  62. driver: bridge
  63. driver_options: "{{ devture_systemd_docker_base_container_networks_driver_options }}"
  64. - name: Ensure matrix-client-fluffychat.service installed
  65. ansible.builtin.template:
  66. src: "{{ role_path }}/templates/systemd/matrix-client-fluffychat.service.j2"
  67. dest: "{{ devture_systemd_docker_base_systemd_path }}/matrix-client-fluffychat.service"
  68. mode: 0644