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.
 
 

67 lines
3.2 KiB

  1. ---
  2. - name: Fail if invalid homeserver implementation
  3. fail:
  4. msg: "You need to set a valid homeserver implementation in `matrix_homeserver_implementation`"
  5. when: "matrix_homeserver_implementation not in ['synapse', 'dendrite']"
  6. # We generally support Ansible 2.7.1 and above.
  7. - name: Fail if running on Ansible < 2.7.1
  8. fail:
  9. msg: "You are running on Ansible {{ ansible_version.string }}, which is not supported. See our guide about Ansible: https://github.com/spantaleev/matrix-docker-ansible-deploy/blob/master/docs/ansible.md"
  10. when:
  11. - "(ansible_version.major < 2) or (ansible_version.major == 2 and ansible_version.minor < 7) or (ansible_version.major == 2 and ansible_version.minor == 7 and ansible_version.revision < 1)"
  12. # Though we do not support Ansible 2.9.6 which is buggy
  13. - name: Fail if running on Ansible 2.9.6 on Ubuntu
  14. fail:
  15. msg: "You are running on Ansible {{ ansible_version.string }}, which is not supported. See our guide about Ansible: https://github.com/spantaleev/matrix-docker-ansible-deploy/blob/master/docs/ansible.md"
  16. when:
  17. - ansible_distribution == 'Ubuntu'
  18. - "ansible_version.major == 2 and ansible_version.minor == 9 and ansible_version.revision == 6"
  19. - name: (Deprecation) Catch and report renamed settings
  20. fail:
  21. msg: >-
  22. Your configuration contains a variable, which now has a different name.
  23. Please change your configuration to rename the variable (`{{ item.old }}` -> `{{ item.new }}`).
  24. when: "item.old in vars"
  25. with_items:
  26. - {'old': 'host_specific_hostname_identity', 'new': 'matrix_domain'}
  27. - {'old': 'hostname_identity', 'new': 'matrix_domain'}
  28. - {'old': 'hostname_matrix', 'new': 'matrix_server_fqn_matrix'}
  29. - {'old': 'hostname_riot', 'new': 'matrix_server_fqn_element'}
  30. - {'old': 'matrix_server_fqn_riot', 'new': 'matrix_server_fqn_element'}
  31. - name: Fail if required variables are undefined
  32. fail:
  33. msg: "The `{{ item }}` variable must be defined and have a non-null value"
  34. with_items:
  35. - matrix_domain
  36. - matrix_server_fqn_matrix
  37. - matrix_server_fqn_element
  38. when: "item not in vars or vars[item] is none"
  39. - name: Fail if uppercase domain used
  40. fail:
  41. msg: "Detected that you're using an uppercase domain name - `{{ item }}`. This will cause trouble. Please use all-lowercase!"
  42. with_items:
  43. - "{{ matrix_domain }}"
  44. - "{{ matrix_server_fqn_matrix }}"
  45. - "{{ matrix_server_fqn_element }}"
  46. when: "item != item|lower"
  47. - name: Fail if using python2 on Archlinux
  48. fail:
  49. msg: "Detected that you're using python2 when installing onto Archlinux. Archlinux by default only supports python3."
  50. when:
  51. - ansible_distribution == 'Archlinux'
  52. - ansible_python.version.major != 3
  53. - name: Fail if architecture is set incorrectly
  54. fail:
  55. msg: "Detected that variable matrix_architecture {{ matrix_architecture }} appears to be set incorrectly. See docs/alternative-architectures.md. Server appears to be {{ ansible_architecture }}."
  56. when: (ansible_architecture == "x86_64" and matrix_architecture != "amd64") or
  57. (ansible_architecture == "aarch64" and matrix_architecture != "arm64") or
  58. (ansible_architecture.startswith("armv") and matrix_architecture != "arm32")