Matrix Docker Ansible eploy
Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.
 
 

80 lignes
2.8 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. when: matrix_conduit_container_network != 'host'
  43. community.general.docker_network:
  44. enable_ipv6: "{{ devture_systemd_docker_base_ipv6_enabled }}"
  45. name: "{{ matrix_conduit_container_network }}"
  46. driver: bridge
  47. driver_options: "{{ devture_systemd_docker_base_container_networks_driver_options }}"
  48. - name: Ensure Conduit container image is pulled
  49. community.docker.docker_image_pull:
  50. name: "{{ matrix_conduit_container_image }}"
  51. pull: always
  52. register: matrix_conduit_container_image_pull_result
  53. retries: "{{ devture_playbook_help_container_retries_count }}"
  54. delay: "{{ devture_playbook_help_container_retries_delay }}"
  55. until: matrix_conduit_container_image_pull_result is not failed
  56. - name: Ensure matrix-conduit.service installed
  57. ansible.builtin.template:
  58. src: "{{ role_path }}/templates/systemd/matrix-conduit.service.j2"
  59. dest: "{{ devture_systemd_docker_base_systemd_path }}/matrix-conduit.service"
  60. mode: '0644'
  61. register: matrix_conduit_systemd_service_result
  62. - name: Determine whether Conduit needs a restart
  63. ansible.builtin.set_fact:
  64. matrix_conduit_restart_necessary: >-
  65. {{
  66. matrix_conduit_config_result.changed | default(false)
  67. or matrix_conduit_support_files_result.changed | default(false)
  68. or matrix_conduit_systemd_service_result.changed | default(false)
  69. or matrix_conduit_container_image_pull_result.changed | default(false)
  70. }}