Matrix Docker Ansible eploy
Não pode escolher mais do que 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.
 
 

62 linhas
2.4 KiB

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