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.
 
 

60 líneas
1.7 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. - "{{ matrix_docker_src_files_path }}"
  23. - "{{ matrix_docker_synapse_src_files_path }}"
  24. # `docker_network` doesn't work as expected when the given network
  25. # is a substring of a network that already exists.
  26. #
  27. # See:
  28. # - https://github.com/spantaleev/matrix-docker-ansible-deploy/issues/12
  29. # - https://github.com/ansible/ansible/issues/32926
  30. #
  31. # Due to that, we employ a workaround below.
  32. #
  33. # - name: Ensure Matrix network is created in Docker
  34. # docker_network:
  35. # name: "{{ matrix_docker_network }}"
  36. # driver: bridge
  37. - name: Check existence of Matrix network in Docker
  38. shell:
  39. cmd: "docker network ls -q --filter='name=^{{ matrix_docker_network }}$'"
  40. register: result_check_docker_network
  41. changed_when: false
  42. check_mode: no
  43. - name: Create Matrix network in Docker
  44. shell:
  45. cmd: "docker network create --driver=bridge {{ matrix_docker_network }}"
  46. when: "result_check_docker_network.stdout == '' and not ansible_check_mode"
  47. - name: Ensure matrix-remove-all script created
  48. template:
  49. src: "{{ role_path }}/templates/usr-local-bin/matrix-remove-all.j2"
  50. dest: "/usr/local/bin/matrix-remove-all"
  51. mode: 0750