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.
 
 

65 lignes
2.3 KiB

  1. ---
  2. - name: Ensure Matrix group is created
  3. group:
  4. name: "{{ matrix_user_username }}"
  5. gid: "{{ matrix_user_gid }}"
  6. state: present
  7. - name: Ensure Matrix user is created
  8. user:
  9. name: "{{ matrix_user_username }}"
  10. uid: "{{ matrix_user_uid }}"
  11. state: present
  12. group: "{{ matrix_user_username }}"
  13. - name: Ensure Matrix base path exists
  14. file:
  15. path: "{{ item }}"
  16. state: directory
  17. mode: "{{ matrix_base_data_path_mode }}"
  18. owner: "{{ matrix_user_username }}"
  19. group: "{{ matrix_user_username }}"
  20. with_items:
  21. - "{{ matrix_base_data_path }}"
  22. - { src: "{{ matrix_docker_src_files_path }}", when: "{{ matrix_raspberry_pi }}" }
  23. - { src: "{{ matrix_docker_synapse_src_files_path }}", when: "{{ matrix_raspberry_pi }}" }
  24. - { src: "{{ matrix_docker_riot_web_src_files_path }}", when: "{{ matrix_raspberry_pi }}" }
  25. - { src: "{{ matrix_docker_coturn_src_files_path }}", when: "{{ matrix_coturn_enabled }}"}
  26. - { src: "{{ matrix_docker_mxisd_src_files_path }}", when: "{{ matrix_mxisd_enabled }}"}
  27. - { src: "{{ matrix_docker_mautrix_facebook_src_files_path }}", when: "{{ matrix_mautrix_facebook_enabled }}"}
  28. - { src: "{{ matrix_docker_mautrix_hangouts_src_files_path }}", when: "{{ matrix_mautrix_hangouts_enabled }}"}
  29. # `docker_network` doesn't work as expected when the given network
  30. # is a substring of a network that already exists.
  31. #
  32. # See:
  33. # - https://github.com/spantaleev/matrix-docker-ansible-deploy/issues/12
  34. # - https://github.com/ansible/ansible/issues/32926
  35. #
  36. # Due to that, we employ a workaround below.
  37. #
  38. # - name: Ensure Matrix network is created in Docker
  39. # docker_network:
  40. # name: "{{ matrix_docker_network }}"
  41. # driver: bridge
  42. - name: Check existence of Matrix network in Docker
  43. shell:
  44. cmd: "docker network ls -q --filter='name=^{{ matrix_docker_network }}$'"
  45. register: result_check_docker_network
  46. changed_when: false
  47. check_mode: no
  48. - name: Create Matrix network in Docker
  49. shell:
  50. cmd: "docker network create --driver=bridge {{ matrix_docker_network }}"
  51. when: "result_check_docker_network.stdout == '' and not ansible_check_mode"
  52. - name: Ensure matrix-remove-all script created
  53. template:
  54. src: "{{ role_path }}/templates/usr-local-bin/matrix-remove-all.j2"
  55. dest: "/usr/local/bin/matrix-remove-all"
  56. mode: 0750