Matrix Docker Ansible eploy
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

33 line
1.2 KiB

  1. ---
  2. - name: Fail if playbook called incorrectly
  3. fail: msg="The `local_path_media_store` variable needs to be provided to this playbook, via --extra-vars"
  4. when: "local_path_media_store is not defined or local_path_media_store.startswith('<')"
  5. - name: Check if the provided media store directory exists
  6. stat: path="{{ local_path_media_store }}"
  7. delegate_to: 127.0.0.1
  8. become: false
  9. register: local_path_media_store_stat
  10. - name: Fail if provided media_store directory doesn't exist on the local machine
  11. fail: msg="File cannot be found on the local machine at {{ local_path_media_store }}"
  12. when: "not local_path_media_store_stat.stat.exists or not local_path_media_store_stat.stat.isdir"
  13. - name: Ensure matrix-synapse is stopped
  14. service: name=matrix-synapse state=stopped daemon_reload=yes
  15. register: stopping_result
  16. - name: Ensure provided media_store directory is copied to the server
  17. synchronize:
  18. src: "{{ local_path_media_store }}/"
  19. dest: "{{ matrix_synapse_data_path }}/media_store"
  20. delete: yes
  21. - name: Ensure Matrix Synapse is started (if it previously was)
  22. service: name="{{ item }}" state=started daemon_reload=yes
  23. when: stopping_result.changed
  24. with_items:
  25. - matrix-synapse
  26. - matrix-nginx-proxy