ade5bfa302
By default, Ansible injects a variable for every fact, prefixed with ansible_. This can result in a large number of variables for each host, which at scale can incur a performance penalty. Ansible provides a configuration option [0] that can be set to False to prevent this injection of facts. In this case, facts should be referenced via ansible_facts.<fact>. This change updates all references to Ansible facts within Kolla Ansible from using individual fact variables to using the items in the ansible_facts dictionary. This allows users to disable fact variable injection in their Ansible configuration, which may provide some performance improvement. This change disables fact variable injection in the ansible configuration used in CI, to catch any attempts to use the injected variables. [0] https://docs.ansible.com/ansible/latest/reference_appendices/config.html#inject-facts-as-vars Change-Id: I7e9d5c9b8b9164d4aee3abb4e37c8f28d98ff5d1 Partially-Implements: blueprint performance-improvements
21 lines
964 B
YAML
21 lines
964 B
YAML
---
|
|
- name: Checking docker SDK version
|
|
command: "{{ ansible_facts.python.executable }} -c \"import docker; print(docker.__version__)\""
|
|
register: result
|
|
changed_when: false
|
|
when: inventory_hostname in groups['baremetal']
|
|
failed_when: result is failed or result.stdout is version(docker_py_version_min, '<')
|
|
|
|
# NOTE(osmanlicilegi): ansible_version.full includes patch number that's useless
|
|
# to check. as ansible_version does not provide major.minor in dict, we need to
|
|
# set it as variable.
|
|
- name: Checking Ansible version
|
|
vars:
|
|
ansible_version_host: "{{ ansible_version.major }}.{{ ansible_version.minor }}"
|
|
fail:
|
|
msg: >-
|
|
Ansible version should be between {{ ansible_version_min }} and {{ ansible_version_max }}.
|
|
Current version is {{ ansible_version.full }} which is not supported.
|
|
run_once: true
|
|
when: ansible_version_host is version(ansible_version_min, '<') or ansible_version_host is version(ansible_version_max, '>')
|