Matrix Docker Ansible eploy
No puede seleccionar más de 25 temas Los temas deben comenzar con una letra o número, pueden incluir guiones ('-') y pueden tener hasta 35 caracteres de largo.
 
 

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