Matrix Docker Ansible eploy
Non puoi selezionare più di 25 argomenti Gli argomenti devono iniziare con una lettera o un numero, possono includere trattini ('-') e possono essere lunghi fino a 35 caratteri.
 
 

35 righe
1.3 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-dendrite is started
  15. ansible.builtin.service:
  16. name: matrix-dendrite
  17. state: started
  18. daemon_reload: true
  19. register: start_result
  20. - name: Wait a while, so that Dendrite can manage to start
  21. ansible.builtin.pause:
  22. seconds: 7
  23. when: start_result.changed | bool
  24. - name: Register user
  25. ansible.builtin.command:
  26. cmd: "{{ {{ matrix_dendrite_bin_path }} }}/create-account {{ username | quote }} {{ password | quote }} {{ '1' if admin == 'yes' else '0' }}"
  27. register: matrix_dendrite_register_user_result
  28. changed_when: matrix_dendrite_register_user_result.rc == 0