Matrix Docker Ansible eploy
Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.
 
 

74 lignes
2.1 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 configured
  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/riot-web/config.json.j2", name: "config.json"}
  26. - {src: "{{ matrix_riot_web_homepage_template }}", name: "home.html"}
  27. when: matrix_riot_web_enabled
  28. - name: Ensure matrix-riot-web.service installed
  29. template:
  30. src: "{{ role_path }}/templates/systemd/matrix-riot-web.service.j2"
  31. dest: "/etc/systemd/system/matrix-riot-web.service"
  32. mode: 0644
  33. when: matrix_riot_web_enabled
  34. #
  35. # Tasks related to getting rid of riot-web (if it was previously enabled)
  36. #
  37. - name: Check existence of matrix-riot-web service
  38. stat:
  39. path: "/etc/systemd/system/matrix-riot-web.service"
  40. register: matrix_riot_web_service_stat
  41. - name: Ensure matrix-riot-web is stopped
  42. service:
  43. name: matrix-riot-web
  44. state: stopped
  45. daemon_reload: yes
  46. register: stopping_result
  47. when: "not matrix_riot_web_enabled and matrix_riot_web_service_stat.stat.exists"
  48. - name: Ensure matrix-riot-web.service doesn't exist
  49. file:
  50. path: "/etc/systemd/system/matrix-riot-web.service"
  51. state: absent
  52. when: "not matrix_riot_web_enabled and matrix_riot_web_service_stat.stat.exists"
  53. - name: Ensure Matrix riot-web paths doesn't exist
  54. file:
  55. path: "{{ matrix_riot_web_data_path }}"
  56. state: absent
  57. when: "not matrix_riot_web_enabled"
  58. - name: Ensure riot-web Docker image doesn't exist
  59. docker_image:
  60. name: "{{ matrix_riot_web_docker_image }}"
  61. state: absent
  62. when: "not matrix_riot_web_enabled"