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.
 
 

83 Zeilen
2.5 KiB

  1. ---
  2. #
  3. # Tasks related to setting up riot-web
  4. #
  5. - name: Ensure Matrix riot-web path exists
  6. file:
  7. path: "{{ matrix_riot_web_data_path }}"
  8. state: directory
  9. mode: 0750
  10. owner: "{{ matrix_user_username }}"
  11. group: "{{ matrix_user_username }}"
  12. when: matrix_riot_web_enabled
  13. - name: Ensure riot-web Docker image is pulled
  14. docker_image:
  15. name: "{{ matrix_riot_web_docker_image }}"
  16. when: matrix_riot_web_enabled
  17. - name: Ensure Matrix riot-web config files installed
  18. template:
  19. src: "{{ item.src }}"
  20. dest: "{{ matrix_riot_web_data_path }}/{{ item.name }}"
  21. mode: 0644
  22. owner: "{{ matrix_user_username }}"
  23. group: "{{ matrix_user_username }}"
  24. with_items:
  25. - {src: "{{ role_path }}/templates/config.json.j2", name: "config.json"}
  26. - {src: "{{ role_path }}/templates/nginx.conf.j2", name: "nginx.conf"}
  27. - {src: "{{ matrix_riot_web_embedded_pages_home_path }}", name: "home.html"}
  28. when: "matrix_riot_web_enabled and item.src is not none"
  29. - name: Ensure Matrix riot-web config files removed
  30. file:
  31. path: "{{ matrix_riot_web_data_path }}/{{ item.name }}"
  32. state: absent
  33. with_items:
  34. - {src: "{{ matrix_riot_web_embedded_pages_home_path }}", name: "home.html"}
  35. when: "matrix_riot_web_enabled and item.src is none"
  36. - name: Ensure matrix-riot-web.service installed
  37. template:
  38. src: "{{ role_path }}/templates/systemd/matrix-riot-web.service.j2"
  39. dest: "/etc/systemd/system/matrix-riot-web.service"
  40. mode: 0644
  41. when: matrix_riot_web_enabled
  42. #
  43. # Tasks related to getting rid of riot-web (if it was previously enabled)
  44. #
  45. - name: Check existence of matrix-riot-web service
  46. stat:
  47. path: "/etc/systemd/system/matrix-riot-web.service"
  48. register: matrix_riot_web_service_stat
  49. - name: Ensure matrix-riot-web is stopped
  50. service:
  51. name: matrix-riot-web
  52. state: stopped
  53. daemon_reload: yes
  54. register: stopping_result
  55. when: "not matrix_riot_web_enabled and matrix_riot_web_service_stat.stat.exists"
  56. - name: Ensure matrix-riot-web.service doesn't exist
  57. file:
  58. path: "/etc/systemd/system/matrix-riot-web.service"
  59. state: absent
  60. when: "not matrix_riot_web_enabled and matrix_riot_web_service_stat.stat.exists"
  61. - name: Ensure Matrix riot-web paths doesn't exist
  62. file:
  63. path: "{{ matrix_riot_web_data_path }}"
  64. state: absent
  65. when: "not matrix_riot_web_enabled"
  66. - name: Ensure riot-web Docker image doesn't exist
  67. docker_image:
  68. name: "{{ matrix_riot_web_docker_image }}"
  69. state: absent
  70. when: "not matrix_riot_web_enabled"