Matrix Docker Ansible eploy
Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.

54 строки
2.1 KiB

  1. ---
  2. - set_fact:
  3. matrix_ansible_outdated_fail_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"
  4. - name: Fail if running on Ansible < 2.5
  5. fail:
  6. msg: "{{ matrix_ansible_outdated_fail_msg }}"
  7. when: "ansible_version.major <= 2 and ansible_version.minor < 5"
  8. # Ansible 2.5.0 and 2.5.1 are known to have a bug with `include_tasks` + `with_items`.
  9. # The bug has been fixed in Ansible 2.5.2.
  10. - name: Fail if running on Ansible 2.5.x (lower than 2.5.2)
  11. fail:
  12. msg: "{{ matrix_ansible_outdated_fail_msg }}"
  13. when: "ansible_version.major == 2 and ansible_version.minor == 5 and ansible_version.revision < 2"
  14. - name: (Deprecation) Catch and report renamed settings
  15. fail:
  16. msg: >-
  17. Your configuration contains a variable, which now has a different name.
  18. Please change your configuration to rename the variable (`{{ item.old }}` -> `{{ item.new }}`).
  19. when: "item.old in vars"
  20. with_items:
  21. - {'old': 'host_specific_hostname_identity', 'new': 'matrix_domain'}
  22. - {'old': 'hostname_identity', 'new': 'matrix_domain'}
  23. - {'old': 'hostname_matrix', 'new': 'matrix_server_fqn_matrix'}
  24. - {'old': 'hostname_riot', 'new': 'matrix_server_fqn_riot'}
  25. - name: Fail if required variables are undefined
  26. fail:
  27. msg: "The `{{ item }}` variable must be defined and have a non-null value"
  28. with_items:
  29. - matrix_domain
  30. - matrix_server_fqn_matrix
  31. - matrix_server_fqn_riot
  32. when: "item not in vars or vars[item] is none"
  33. - name: Fail if uppercase domain used
  34. fail:
  35. msg: "Detected that you're using an uppercase domain name - `{{ item }}`. This will cause trouble. Please use all-lowercase!"
  36. with_items:
  37. - "{{ matrix_domain }}"
  38. - "{{ matrix_server_fqn_matrix }}"
  39. - "{{ matrix_server_fqn_riot }}"
  40. when: "item != item|lower"
  41. - name: Fail if using python2 on Archlinux
  42. fail:
  43. msg: "Detected that you're using python2 when installing onto Archlinux. Archlinux by default only supports python3."
  44. when:
  45. - ansible_distribution == 'Archlinux'
  46. - ansible_python.version.major != 3