Matrix Docker Ansible eploy
Nevar pievienot vairāk kā 25 tēmas Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.
 
 

34 rindas
1.2 KiB

  1. ---
  2. - name: Fail if playbook called incorrectly
  3. ansible.builtin.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. ansible.builtin.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 playbook called incorrectly
  11. ansible.builtin.fail:
  12. msg: "The `admin` variable needs to be provided to this playbook, via --extra-vars"
  13. when: "admin is not defined or admin not in ['yes', 'no']"
  14. - name: Ensure matrix-synapse is started
  15. ansible.builtin.service:
  16. name: matrix-synapse
  17. state: started
  18. daemon_reload: true
  19. register: start_result
  20. - name: Wait a while, so that Synapse can manage to start
  21. ansible.builtin.pause:
  22. seconds: 7
  23. when: "start_result.changed"
  24. - name: Register user
  25. ansible.builtin.command: "{{ matrix_local_bin_path }}/matrix-synapse-register-user {{ username|quote }} {{ password|quote }} {{ '1' if admin == 'yes' else '0' }}"
  26. register: matrix_synapse_register_user_result
  27. changed_when: matrix_synapse_register_user_result.rc == 0