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.
 
 

42 rivejä
1.4 KiB

  1. ---
  2. - name: Fail if playbook called incorrectly
  3. fail:
  4. msg: "The `username` variable needs to be provided to this playbook, via --extra-vars"
  5. when: "username is not defined or username == '<your-username>'"
  6. - name: Fail if playbook called incorrectly
  7. fail:
  8. msg: "The `password` variable needs to be provided to this playbook, via --extra-vars"
  9. when: "password is not defined or password == '<your-password>'"
  10. - name: Fail if not using matrix-postgres container
  11. fail:
  12. msg: "This command is working only when matrix-postgres container is being used"
  13. when: "not matrix_postgres_enabled|bool"
  14. - name: Ensure matrix-dendrite is started
  15. service:
  16. name: matrix-dendrite
  17. state: started
  18. daemon_reload: yes
  19. register: start_result
  20. - name: Ensure matrix-postgres is started
  21. service:
  22. name: matrix-postgres
  23. state: started
  24. daemon_reload: yes
  25. register: postgres_start_result
  26. - name: Wait a while, so that Matrix Dendrite can manage to start
  27. pause:
  28. seconds: 7
  29. when: "start_result.changed or postgres_start_result.changed"
  30. - name: Generate password hash
  31. shell: "{{ matrix_host_command_docker }} exec matrix-dendrite /usr/local/bin/hash_password -c /data/homeserver.yaml -p {{ password|quote }}"
  32. register: password_hash
  33. - name: Update user password hash
  34. command: "{{ matrix_local_bin_path }}/matrix-postgres-update-user-password-hash {{ username|quote }} {{ password_hash.stdout|quote }}"