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.
 
 

75 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/config.json.j2", name: "config.json"}
  26. - {src: "{{ role_path }}/templates/nginx.conf.j2", name: "nginx.conf"}
  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:
  40. path: "/etc/systemd/system/matrix-riot-web.service"
  41. register: matrix_riot_web_service_stat
  42. - name: Ensure matrix-riot-web is stopped
  43. service:
  44. name: matrix-riot-web
  45. state: stopped
  46. daemon_reload: yes
  47. register: stopping_result
  48. when: "not matrix_riot_web_enabled and matrix_riot_web_service_stat.stat.exists"
  49. - name: Ensure matrix-riot-web.service doesn't exist
  50. file:
  51. path: "/etc/systemd/system/matrix-riot-web.service"
  52. state: absent
  53. when: "not matrix_riot_web_enabled and matrix_riot_web_service_stat.stat.exists"
  54. - name: Ensure Matrix riot-web paths doesn't exist
  55. file:
  56. path: "{{ matrix_riot_web_data_path }}"
  57. state: absent
  58. when: "not matrix_riot_web_enabled"
  59. - name: Ensure riot-web Docker image doesn't exist
  60. docker_image:
  61. name: "{{ matrix_riot_web_docker_image }}"
  62. state: absent
  63. when: "not matrix_riot_web_enabled"