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.
 
 

81 satır
3.1 KiB

  1. # SPDX-FileCopyrightText: 2022 - 2024 Slavi Pantaleev
  2. # SPDX-FileCopyrightText: 2022 Charles Wright
  3. # SPDX-FileCopyrightText: 2022 Sebastian Gumprich
  4. # SPDX-FileCopyrightText: 2024 David Mehren
  5. # SPDX-FileCopyrightText: 2024 Samuel Meenzen
  6. #
  7. # SPDX-License-Identifier: AGPL-3.0-or-later
  8. ---
  9. - name: Ensure Conduit config path exists
  10. ansible.builtin.file:
  11. path: "{{ matrix_conduit_config_path }}"
  12. state: directory
  13. mode: '0750'
  14. owner: "{{ matrix_user_name }}"
  15. group: "{{ matrix_group_name }}"
  16. - name: Ensure Conduit data path exists
  17. ansible.builtin.file:
  18. path: "{{ matrix_conduit_data_path }}"
  19. state: directory
  20. mode: '0770'
  21. owner: "{{ matrix_user_name }}"
  22. group: "{{ matrix_group_name }}"
  23. - name: Ensure Conduit configuration installed
  24. ansible.builtin.template:
  25. src: "{{ matrix_conduit_template_conduit_config }}"
  26. dest: "{{ matrix_conduit_config_path }}/conduit.toml"
  27. mode: '0644'
  28. owner: "{{ matrix_user_name }}"
  29. group: "{{ matrix_group_name }}"
  30. register: matrix_conduit_config_result
  31. - name: Ensure Conduit support files installed
  32. ansible.builtin.template:
  33. src: "{{ role_path }}/templates/{{ item }}.j2"
  34. dest: "{{ matrix_conduit_base_path }}/{{ item }}"
  35. mode: '0640'
  36. owner: "{{ matrix_user_name }}"
  37. group: "{{ matrix_group_name }}"
  38. with_items:
  39. - labels
  40. register: matrix_conduit_support_files_result
  41. - name: Ensure Conduit container network is created
  42. community.general.docker_network:
  43. enable_ipv6: "{{ devture_systemd_docker_base_ipv6_enabled }}"
  44. name: "{{ matrix_conduit_container_network }}"
  45. driver: bridge
  46. driver_options: "{{ devture_systemd_docker_base_container_networks_driver_options }}"
  47. - name: Ensure Conduit container image is pulled
  48. community.docker.docker_image:
  49. name: "{{ matrix_conduit_container_image }}"
  50. source: "{{ 'pull' if ansible_version.major > 2 or ansible_version.minor > 7 else omit }}"
  51. force_source: "{{ matrix_conduit_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_conduit_container_image_force_pull }}"
  53. register: matrix_conduit_container_image_pull_result
  54. retries: "{{ devture_playbook_help_container_retries_count }}"
  55. delay: "{{ devture_playbook_help_container_retries_delay }}"
  56. until: matrix_conduit_container_image_pull_result is not failed
  57. - name: Ensure matrix-conduit.service installed
  58. ansible.builtin.template:
  59. src: "{{ role_path }}/templates/systemd/matrix-conduit.service.j2"
  60. dest: "{{ devture_systemd_docker_base_systemd_path }}/matrix-conduit.service"
  61. mode: '0644'
  62. register: matrix_conduit_systemd_service_result
  63. - name: Determine whether Conduit needs a restart
  64. ansible.builtin.set_fact:
  65. matrix_conduit_restart_necessary: >-
  66. {{
  67. matrix_conduit_config_result.changed | default(false)
  68. or matrix_conduit_support_files_result.changed | default(false)
  69. or matrix_conduit_systemd_service_result.changed | default(false)
  70. or matrix_conduit_container_image_pull_result.changed | default(false)
  71. }}