Matrix Docker Ansible eploy
Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.
 
 

79 строки
2.5 KiB

  1. ---
  2. #
  3. # Tasks related to setting up mxisd
  4. #
  5. - name: (Deprecation) Fail if using outdated configuration
  6. fail:
  7. msg: "You're using the `matrix_mxisd_ldap_connection_baseDn` variable (single string), which has been superseded by `matrix_mxisd_ldap_connection_baseDns` (array of strings). See https://github.com/spantaleev/matrix-docker-ansible-deploy/blob/master/CHANGELOG.md#bc-break-mxisd-upgrade-with-multiple-base-dn-support"
  8. when: "matrix_mxisd_ldap_connection_baseDn is defined"
  9. - name: Fail if mailer is not enabled
  10. fail:
  11. msg: "You need to enable the mailer service (matrix_mailer_enabled) to install mxisd"
  12. when: "matrix_mxisd_enabled and not matrix_mailer_enabled"
  13. - name: Ensure mxisd paths exist
  14. file:
  15. path: "{{ item }}"
  16. state: directory
  17. mode: 0750
  18. owner: "{{ matrix_user_username }}"
  19. group: "{{ matrix_user_username }}"
  20. with_items:
  21. - "{{ matrix_mxisd_config_path }}"
  22. - "{{ matrix_mxisd_data_path }}"
  23. when: matrix_mxisd_enabled
  24. - name: Ensure mxisd image is pulled
  25. docker_image:
  26. name: "{{ matrix_mxisd_docker_image }}"
  27. when: matrix_mxisd_enabled
  28. - name: Ensure mxisd config installed
  29. template:
  30. src: "{{ matrix_mxisd_template_config }}"
  31. dest: "{{ matrix_mxisd_config_path }}/mxisd.yaml"
  32. mode: 0644
  33. owner: "{{ matrix_user_username }}"
  34. group: "{{ matrix_user_username }}"
  35. when: matrix_mxisd_enabled
  36. - name: Ensure matrix-mxisd.service installed
  37. template:
  38. src: "{{ role_path }}/templates/systemd/matrix-mxisd.service.j2"
  39. dest: "/etc/systemd/system/matrix-mxisd.service"
  40. mode: 0644
  41. when: matrix_mxisd_enabled
  42. #
  43. # Tasks related to getting rid of mxisd (if it was previously enabled)
  44. #
  45. - name: Check existence of matrix-mxisd service
  46. stat: path="/etc/systemd/system/matrix-mxisd.service"
  47. register: matrix_mxisd_service_stat
  48. - name: Ensure matrix-mxisd is stopped
  49. service: name=matrix-mxisd state=stopped daemon_reload=yes
  50. register: stopping_result
  51. when: "not matrix_mxisd_enabled and matrix_mxisd_service_stat.stat.exists"
  52. - name: Ensure matrix-mxisd.service doesn't exist
  53. file:
  54. path: "/etc/systemd/system/matrix-mxisd.service"
  55. state: absent
  56. when: "not matrix_mxisd_enabled and matrix_mxisd_service_stat.stat.exists"
  57. - name: Ensure Matrix mxisd paths don't exist
  58. file:
  59. path: "{{ matrix_mxisd_base_path }}"
  60. state: absent
  61. when: "not matrix_mxisd_enabled"
  62. - name: Ensure mxisd Docker image doesn't exist
  63. docker_image:
  64. name: "{{ matrix_mxisd_docker_image }}"
  65. state: absent
  66. when: "not matrix_mxisd_enabled"