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.
 
 

73 lines
3.6 KiB

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