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.
30 lines
1.3 KiB
30 lines
1.3 KiB
---
|
|
|
|
- set_fact:
|
|
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"
|
|
|
|
- name: Fail if running on Ansible < 2.4
|
|
fail:
|
|
msg: "{{ matrix_ansible_outdated_fail_msg }}"
|
|
when: "ansible_version.major <= 2 and ansible_version.minor < 4"
|
|
|
|
# Ansible 2.5.0 and 2.5.1 are known to have a bug with `include_tasks` + `with_items`.
|
|
# The bug has been fixed in Ansible 2.5.2.
|
|
- name: Fail if running on Ansible 2.5.x (lower than 2.5.2)
|
|
fail:
|
|
msg: "{{ matrix_ansible_outdated_fail_msg }}"
|
|
when: "ansible_version.major == 2 and ansible_version.minor == 5 and ansible_version.revision < 2"
|
|
|
|
# This sanity check is only used to detect uppercase when people override these specific variables.
|
|
#
|
|
# If people set `host_specific_hostname_identity` without overriding other variables (the general use-case),
|
|
# we take care to lower-case it automatically and it won't cause trouble anyway.
|
|
- name: Fail if uppercase domain used
|
|
fail:
|
|
msg: "Detected that you're using an uppercase domain name - `{{ item }}`. This will cause trouble. Please use all-lowercase!"
|
|
when: "item != item|lower"
|
|
with_items:
|
|
- "{{ hostname_identity }}"
|
|
- "{{ hostname_matrix }}"
|
|
- "{{ hostname_riot }}"
|