Matrix Docker Ansible eploy
Du kannst nicht mehr als 25 Themen auswählen Themen müssen entweder mit einem Buchstaben oder einer Ziffer beginnen. Sie können Bindestriche („-“) enthalten und bis zu 35 Zeichen lang sein.
 
 

78 Zeilen
3.4 KiB

  1. # SPDX-FileCopyrightText: 2022 - 2023 Julian-Samuel Gebühr
  2. # SPDX-FileCopyrightText: 2022 - 2024 Slavi Pantaleev
  3. # SPDX-FileCopyrightText: 2022 Sebastian Gumprich
  4. #
  5. # SPDX-License-Identifier: AGPL-3.0-or-later
  6. ---
  7. - name: Ensure matrix-cactus-comments paths exist
  8. ansible.builtin.file:
  9. path: "{{ item.path }}"
  10. state: directory
  11. mode: 0750
  12. owner: "{{ matrix_user_name }}"
  13. group: "{{ matrix_group_name }}"
  14. with_items:
  15. - {path: "{{ matrix_cactus_comments_base_path }}", when: true}
  16. - {path: "{{ matrix_cactus_comments_container_tmp_path }}", when: true}
  17. - {path: "{{ matrix_cactus_comments_docker_src_files_path }}", when: matrix_cactus_comments_container_image_self_build}
  18. when: "item.when | bool"
  19. - name: Ensure matrix-cactus-comments environment file created
  20. ansible.builtin.template:
  21. src: "{{ role_path }}/templates/env.j2"
  22. dest: "{{ matrix_cactus_comments_app_service_env_file }}"
  23. owner: "{{ matrix_user_name }}"
  24. group: "{{ matrix_group_name }}"
  25. mode: 0640
  26. - name: Ensure matrix-cactus-comments appservice file created
  27. ansible.builtin.template:
  28. src: "{{ role_path }}/templates/cactus_appservice.yaml.j2"
  29. dest: "{{ matrix_cactus_comments_app_service_config_file }}"
  30. owner: "{{ matrix_user_name }}"
  31. group: "{{ matrix_group_name }}"
  32. mode: 0640
  33. - name: Ensure matrix-cactus-comments image is pulled
  34. community.docker.docker_image:
  35. name: "{{ matrix_cactus_comments_docker_image }}"
  36. source: "{{ 'pull' if ansible_version.major > 2 or ansible_version.minor > 7 else omit }}"
  37. force_source: "{{ matrix_cactus_comments_docker_image_force_pull if ansible_version.major > 2 or ansible_version.minor >= 8 else omit }}"
  38. force: "{{ omit if ansible_version.major > 2 or ansible_version.minor >= 8 else matrix_cactus_comments_docker_image_force_pull }}"
  39. when: "not matrix_cactus_comments_container_image_self_build | bool"
  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 matrix-cactus-comments repository is present on self-build
  45. ansible.builtin.git:
  46. repo: "{{ matrix_cactus_comments_docker_repo }}"
  47. version: "{{ matrix_cactus_comments_docker_repo_version }}"
  48. dest: "{{ matrix_cactus_comments_docker_src_files_path }}"
  49. force: "yes"
  50. become: true
  51. become_user: "{{ matrix_user_name }}"
  52. register: matrix_cactus_comments_git_pull_results
  53. when: "matrix_cactus_comments_container_image_self_build | bool"
  54. - name: Ensure matrix-cactus-comments image is built
  55. community.docker.docker_image:
  56. name: "{{ matrix_cactus_comments_docker_image }}"
  57. source: build
  58. force_source: "{{ matrix_cactus_comments_git_pull_results.changed if ansible_version.major > 2 or ansible_version.minor >= 8 else omit }}"
  59. force: "{{ omit if ansible_version.major > 2 or ansible_version.minor >= 8 else matrix_cactus_comments_git_pull_results.changed }}"
  60. build:
  61. dockerfile: Dockerfile
  62. path: "{{ matrix_cactus_comments_docker_src_files_path }}"
  63. pull: true
  64. when: "matrix_cactus_comments_container_image_self_build | bool"
  65. - name: Ensure matrix-cactus-comments.service installed
  66. ansible.builtin.template:
  67. src: "{{ role_path }}/templates/systemd/matrix-cactus-comments.service.j2"
  68. dest: "{{ devture_systemd_docker_base_systemd_path }}/matrix-cactus-comments.service"
  69. mode: 0644