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 regels
2.6 KiB

  1. # SPDX-FileCopyrightText: 2021 Yannick Goossens
  2. # SPDX-FileCopyrightText: 2022 - 2024 Slavi Pantaleev
  3. # SPDX-FileCopyrightText: 2022 Jim Myhrberg
  4. # SPDX-FileCopyrightText: 2022 Marko Weltzer
  5. # SPDX-FileCopyrightText: 2022 Nikita Chernyi
  6. # SPDX-FileCopyrightText: 2022 Sebastian Gumprich
  7. # SPDX-FileCopyrightText: 2024 David Mehren
  8. #
  9. # SPDX-License-Identifier: AGPL-3.0-or-later
  10. ---
  11. - name: Ensure go-neb paths exist
  12. ansible.builtin.file:
  13. path: "{{ item.path }}"
  14. state: directory
  15. mode: 0750
  16. owner: "{{ matrix_user_name }}"
  17. group: "{{ matrix_group_name }}"
  18. with_items:
  19. - {path: "{{ matrix_bot_go_neb_config_path }}", when: true}
  20. - {path: "{{ matrix_bot_go_neb_data_path }}", when: true}
  21. - {path: "{{ matrix_bot_go_neb_data_store_path }}", when: true}
  22. when: "item.when | bool"
  23. - name: Ensure go-neb config installed
  24. ansible.builtin.copy:
  25. content: "{{ matrix_bot_go_neb_configuration | to_nice_yaml(indent=2, width=999999) }}"
  26. dest: "{{ matrix_bot_go_neb_config_path }}/config.yaml"
  27. mode: 0644
  28. owner: "{{ matrix_user_name }}"
  29. group: "{{ matrix_group_name }}"
  30. - name: Ensure go-neb support files installed
  31. ansible.builtin.template:
  32. src: "{{ role_path }}/templates/{{ item }}.j2"
  33. dest: "{{ matrix_bot_go_neb_base_path }}/{{ item }}"
  34. mode: 0640
  35. owner: "{{ matrix_user_name }}"
  36. group: "{{ matrix_group_name }}"
  37. with_items:
  38. - env
  39. - labels
  40. - name: Ensure go-neb container image is pulled
  41. community.docker.docker_image:
  42. name: "{{ matrix_bot_go_neb_container_image }}"
  43. source: "{{ 'pull' if ansible_version.major > 2 or ansible_version.minor > 7 else omit }}"
  44. force_source: "{{ matrix_bot_go_neb_container_image_force_pull if ansible_version.major > 2 or ansible_version.minor >= 8 else omit }}"
  45. force: "{{ omit if ansible_version.major > 2 or ansible_version.minor >= 8 else matrix_bot_go_neb_container_image_force_pull }}"
  46. register: result
  47. retries: "{{ devture_playbook_help_container_retries_count }}"
  48. delay: "{{ devture_playbook_help_container_retries_delay }}"
  49. until: result is not failed
  50. - name: Ensure go-neb container network is created
  51. community.general.docker_network:
  52. enable_ipv6: "{{ devture_systemd_docker_base_ipv6_enabled }}"
  53. name: "{{ matrix_bot_go_neb_container_network }}"
  54. driver: bridge
  55. driver_options: "{{ devture_systemd_docker_base_container_networks_driver_options }}"
  56. - name: Ensure matrix-bot-go-neb.service installed
  57. ansible.builtin.template:
  58. src: "{{ role_path }}/templates/systemd/matrix-bot-go-neb.service.j2"
  59. dest: "{{ devture_systemd_docker_base_systemd_path }}/matrix-bot-go-neb.service"
  60. mode: 0644