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.
 
 

68 lines
2.5 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. - name: Ensure Conduit support files installed
  31. ansible.builtin.template:
  32. src: "{{ role_path }}/templates/{{ item }}.j2"
  33. dest: "{{ matrix_conduit_base_path }}/{{ item }}"
  34. mode: '0640'
  35. owner: "{{ matrix_user_name }}"
  36. group: "{{ matrix_group_name }}"
  37. with_items:
  38. - labels
  39. - name: Ensure Conduit container network is created
  40. community.general.docker_network:
  41. enable_ipv6: "{{ devture_systemd_docker_base_ipv6_enabled }}"
  42. name: "{{ matrix_conduit_container_network }}"
  43. driver: bridge
  44. driver_options: "{{ devture_systemd_docker_base_container_networks_driver_options }}"
  45. - name: Ensure Conduit container image is pulled
  46. community.docker.docker_image:
  47. name: "{{ matrix_conduit_container_image }}"
  48. source: "{{ 'pull' if ansible_version.major > 2 or ansible_version.minor > 7 else omit }}"
  49. force_source: "{{ matrix_conduit_container_image_force_pull if ansible_version.major > 2 or ansible_version.minor >= 8 else omit }}"
  50. force: "{{ omit if ansible_version.major > 2 or ansible_version.minor >= 8 else matrix_conduit_container_image_force_pull }}"
  51. register: result
  52. retries: "{{ devture_playbook_help_container_retries_count }}"
  53. delay: "{{ devture_playbook_help_container_retries_delay }}"
  54. until: result is not failed
  55. - name: Ensure matrix-conduit.service installed
  56. ansible.builtin.template:
  57. src: "{{ role_path }}/templates/systemd/matrix-conduit.service.j2"
  58. dest: "{{ devture_systemd_docker_base_systemd_path }}/matrix-conduit.service"
  59. mode: '0644'