Matrix Docker Ansible eploy
Du kannst nicht mehr als 25 Themen auswählen Themen müssen entweder mit einem Buchstaben oder einer Ziffer beginnen. Sie können Bindestriche („-“) enthalten und bis zu 35 Zeichen lang sein.
 
 

41 Zeilen
1.4 KiB

  1. # SPDX-FileCopyrightText: 2022 Jip J. Dekker
  2. # SPDX-FileCopyrightText: 2022 Marko Weltzer
  3. # SPDX-FileCopyrightText: 2022 Slavi Pantaleev
  4. #
  5. # SPDX-License-Identifier: AGPL-3.0-or-later
  6. ---
  7. - name: Fail if playbook called incorrectly
  8. ansible.builtin.fail:
  9. msg: "The `username` variable needs to be provided to this playbook, via --extra-vars"
  10. when: "username is not defined or username == '<your-username>'"
  11. - name: Fail if playbook called incorrectly
  12. ansible.builtin.fail:
  13. msg: "The `password` variable needs to be provided to this playbook, via --extra-vars"
  14. when: "password is not defined or password == '<your-password>'"
  15. - name: Fail if playbook called incorrectly
  16. ansible.builtin.fail:
  17. msg: "The `admin` variable needs to be provided to this playbook, via --extra-vars"
  18. when: "admin is not defined or admin not in ['yes', 'no']"
  19. - name: Ensure matrix-dendrite is started
  20. ansible.builtin.service:
  21. name: matrix-dendrite
  22. state: started
  23. daemon_reload: true
  24. register: start_result
  25. - name: Wait a while, so that Dendrite can manage to start
  26. ansible.builtin.pause:
  27. seconds: 7
  28. when: start_result.changed | bool
  29. - name: Register user
  30. ansible.builtin.command:
  31. cmd: "{{ matrix_dendrite_bin_path }}/create-account {{ username | quote }} {{ password | quote }} {{ '1' if admin == 'yes' else '0' }}"
  32. register: matrix_dendrite_register_user_result
  33. changed_when: matrix_dendrite_register_user_result.rc == 0