Updated use of deprecated filter

This was removed in Ansible 2.9.

[DEPRECATION WARNING]: Using tests as filters is deprecated. Instead of
using `result|version_compare` use `result is version_compare`. This
feature will be removed in version 2.9. Deprecation warnings can be
disabled by setting deprecation_warnings=False in ansible.cfg.

Rename 'version_compare' to the function 'version'.

version_compose was renamed to version since ansible 2.5

Signed-off-by: abaird-rh <abaird@redhat.com>
(cherry picked from commit eb71244bfd)
pull/5298/head
abaird-rh 2020-04-17 17:34:32 +01:00 committed by Dimitri Savineau
parent e4c24f3407
commit 6878aab0f9
12 changed files with 21 additions and 21 deletions

View File

@ -2,24 +2,24 @@
- name: set_fact ceph_release jewel
set_fact:
ceph_release: jewel
when: ceph_version.split('.')[0] is version_compare('10', '==')
when: ceph_version.split('.')[0] is version('10', '==')
- name: set_fact ceph_release kraken
set_fact:
ceph_release: kraken
when: ceph_version.split('.')[0] is version_compare('11', '==')
when: ceph_version.split('.')[0] is version('11', '==')
- name: set_fact ceph_release luminous
set_fact:
ceph_release: luminous
when: ceph_version.split('.')[0] is version_compare('12', '==')
when: ceph_version.split('.')[0] is version('12', '==')
- name: set_fact ceph_release mimic
set_fact:
ceph_release: mimic
when: ceph_version.split('.')[0] is version_compare('13', '==')
when: ceph_version.split('.')[0] is version('13', '==')
- name: set_fact ceph_release nautilus
set_fact:
ceph_release: nautilus
when: ceph_version.split('.')[0] is version_compare('14', '==')
when: ceph_version.split('.')[0] is version('14', '==')

View File

@ -2,25 +2,25 @@
- name: set_fact ceph_release jewel
set_fact:
ceph_release: jewel
when: ceph_version.split('.')[0] is version_compare('10', '==')
when: ceph_version.split('.')[0] is version('10', '==')
- name: set_fact ceph_release kraken
set_fact:
ceph_release: kraken
when: ceph_version.split('.')[0] is version_compare('11', '==')
when: ceph_version.split('.')[0] is version('11', '==')
- name: set_fact ceph_release luminous
set_fact:
ceph_release: luminous
when: ceph_version.split('.')[0] is version_compare('12', '==')
when: ceph_version.split('.')[0] is version('12', '==')
- name: set_fact ceph_release mimic
set_fact:
ceph_release: mimic
when: ceph_version.split('.')[0] is version_compare('13', '==')
when: ceph_version.split('.')[0] is version('13', '==')
- name: set_fact ceph_release nautilus
set_fact:
ceph_release: nautilus
when: ceph_version.split('.')[0] is version_compare('14', '==')
when: ceph_version.split('.')[0] is version('14', '==')

View File

@ -12,7 +12,7 @@ ExecStartPre=-/usr/bin/{{ container_binary }} stop rbd-target-api
ExecStartPre=-/usr/bin/{{ container_binary }} rm rbd-target-api
ExecStart=/usr/bin/{{ container_binary }} run --rm \
--memory={{ ceph_rbd_target_api_docker_memory_limit }} \
{% if (container_binary == 'docker' and ceph_docker_version.split('.')[0] is version_compare('13', '>=')) or container_binary == 'podman' -%}
{% if (container_binary == 'docker' and ceph_docker_version.split('.')[0] is version('13', '>=')) or container_binary == 'podman' -%}
--cpus={{ ceph_rbd_target_api_docker_cpu_limit }} \
{% else -%}
--cpu-quota={{ ceph_rbd_target_api_docker_cpu_limit * 100000 }} \

View File

@ -12,7 +12,7 @@ ExecStartPre=-/usr/bin/{{ container_binary }} stop rbd-target-gw
ExecStartPre=-/usr/bin/{{ container_binary }} rm rbd-target-gw
ExecStart=/usr/bin/{{ container_binary }} run --rm \
--memory={{ ceph_rbd_target_gw_docker_memory_limit }} \
{% if (container_binary == 'docker' and ceph_docker_version.split('.')[0] is version_compare('13', '>=')) or container_binary == 'podman' -%}
{% if (container_binary == 'docker' and ceph_docker_version.split('.')[0] is version('13', '>=')) or container_binary == 'podman' -%}
--cpus={{ ceph_rbd_target_gw_docker_cpu_limit }} \
{% else -%}
--cpu-quota={{ ceph_rbd_target_gw_docker_cpu_limit * 100000 }} \

View File

@ -12,7 +12,7 @@ ExecStartPre=-/usr/bin/{{ container_binary }} stop tcmu-runner
ExecStartPre=-/usr/bin/{{ container_binary }} rm tcmu-runner
ExecStart=/usr/bin/{{ container_binary }} run --rm \
--memory={{ ceph_tcmu_runner_docker_memory_limit }} \
{% if (container_binary == 'docker' and ceph_docker_version.split('.')[0] is version_compare('13', '>=')) or container_binary == 'podman' -%}
{% if (container_binary == 'docker' and ceph_docker_version.split('.')[0] is version('13', '>=')) or container_binary == 'podman' -%}
--cpus={{ ceph_tcmu_runner_docker_cpu_limit }} \
{% else -%}
--cpu-quota={{ ceph_tcmu_runner_docker_cpu_limit * 100000 }} \

View File

@ -13,7 +13,7 @@ ExecStartPre=-/usr/bin/{{ container_binary }} stop ceph-mds-{{ ansible_hostname
ExecStartPre=-/usr/bin/{{ container_binary }} rm ceph-mds-{{ ansible_hostname }}
ExecStart=/usr/bin/{{ container_binary }} run --rm --net=host \
--memory={{ ceph_mds_docker_memory_limit }} \
{% if (container_binary == 'docker' and ceph_docker_version.split('.')[0] is version_compare('13', '>=')) or container_binary == 'podman' -%}
{% if (container_binary == 'docker' and ceph_docker_version.split('.')[0] is version('13', '>=')) or container_binary == 'podman' -%}
--cpus={{ cpu_limit }} \
{% else -%}
--cpu-quota={{ cpu_limit * 100000 }} \

View File

@ -12,7 +12,7 @@ ExecStartPre=-/usr/bin/{{ container_binary }} stop ceph-mgr-{{ ansible_hostname
ExecStartPre=-/usr/bin/{{ container_binary }} rm ceph-mgr-{{ ansible_hostname }}
ExecStart=/usr/bin/{{ container_binary }} run --rm --net=host \
--memory={{ ceph_mgr_docker_memory_limit }} \
{% if (container_binary == 'docker' and ceph_docker_version.split('.')[0] is version_compare('13', '>=')) or container_binary == 'podman' -%}
{% if (container_binary == 'docker' and ceph_docker_version.split('.')[0] is version('13', '>=')) or container_binary == 'podman' -%}
--cpus={{ ceph_mgr_docker_cpu_limit }} \
{% else -%}
--cpu-quota={{ ceph_mgr_docker_cpu_limit * 100000 }} \

View File

@ -12,7 +12,7 @@ ExecStartPre=-/usr/bin/{{ container_binary }} rm ceph-mon-%i
ExecStartPre=/bin/sh -c '"$(command -v mkdir)" -p /etc/ceph /var/lib/ceph/mon'
ExecStart=/usr/bin/{{ container_binary }} run --rm --name ceph-mon-%i \
--memory={{ ceph_mon_docker_memory_limit }} \
{% if (container_binary == 'docker' and ceph_docker_version.split('.')[0] is version_compare('13', '>=')) or container_binary == 'podman' -%}
{% if (container_binary == 'docker' and ceph_docker_version.split('.')[0] is version('13', '>=')) or container_binary == 'podman' -%}
--cpus={{ ceph_mon_docker_cpu_limit }} \
{% else -%}
--cpu-quota={{ ceph_mon_docker_cpu_limit * 100000 }} \

View File

@ -20,7 +20,7 @@ numactl \
{% if osd_objectstore == 'filestore' -%}
--memory={{ ceph_osd_docker_memory_limit }} \
{% endif -%}
{% if (container_binary == 'docker' and ceph_docker_version.split('.')[0] is version_compare('13', '>=')) or container_binary == 'podman' -%}
{% if (container_binary == 'docker' and ceph_docker_version.split('.')[0] is version('13', '>=')) or container_binary == 'podman' -%}
--cpus={{ cpu_limit }} \
{% else -%}
--cpu-quota={{ cpu_limit * 100000 }} \

View File

@ -12,7 +12,7 @@ ExecStartPre=-/usr/bin/{{ container_binary }} stop ceph-rbd-mirror-{{ ansible_ho
ExecStartPre=-/usr/bin/{{ container_binary }} rm ceph-rbd-mirror-{{ ansible_hostname }}
ExecStart=/usr/bin/{{ container_binary }} run --rm --net=host \
--memory={{ ceph_rbd_mirror_docker_memory_limit }} \
{% if (container_binary == 'docker' and ceph_docker_version.split('.')[0] is version_compare('13', '>=')) or container_binary == 'podman' -%}
{% if (container_binary == 'docker' and ceph_docker_version.split('.')[0] is version('13', '>=')) or container_binary == 'podman' -%}
--cpus={{ ceph_rbd_mirror_docker_cpu_limit }} \
{% else -%}
--cpu-quota={{ ceph_rbd_mirror_docker_cpu_limit * 100000 }} \

View File

@ -13,7 +13,7 @@ ExecStartPre=-/usr/bin/{{ container_binary }} stop ceph-rgw-{{ ansible_hostname
ExecStartPre=-/usr/bin/{{ container_binary }} rm ceph-rgw-{{ ansible_hostname }}-${INST_NAME}
ExecStart=/usr/bin/{{ container_binary }} run --rm --net=host \
--memory={{ ceph_rgw_docker_memory_limit }} \
{% if (container_binary == 'docker' and ceph_docker_version.split('.')[0] is version_compare('13', '>=')) or container_binary == 'podman' -%}
{% if (container_binary == 'docker' and ceph_docker_version.split('.')[0] is version('13', '>=')) or container_binary == 'podman' -%}
--cpus={{ cpu_limit }} \
{% else -%}
--cpu-quota={{ cpu_limit * 100000 }} \

View File

@ -34,8 +34,8 @@
- name: fail on unsupported distribution for red hat ceph storage
fail:
msg: "Distribution not supported {{ ansible_distribution_version }} by Red Hat Ceph Storage, only RHEL 8 (>= 8.1) or RHEL 7 (>= 7.7)"
when: (ansible_distribution_major_version | int == 8 and ansible_distribution_version | version_compare('8.1', '<')) or
(ansible_distribution_major_version | int == 7 and ansible_distribution_version | version_compare('7.7', '<'))
when: (ansible_distribution_major_version | int == 8 and ansible_distribution_version is version('8.1', '<')) or
(ansible_distribution_major_version | int == 7 and ansible_distribution_version is version('7.7', '<'))
- name: subscription manager related tasks
when: ceph_repository_type == 'cdn'