mirror of https://github.com/ceph/ceph-ansible.git
Avoid using tests as filter
Fixes the deprecation warning:
[DEPRECATION WARNING]: Using tests as filters is deprecated. Instead of
using `result|search` use `result is search`.
Signed-off-by: Noah Watkins <nwatkins@redhat.com>
(cherry picked from commit 306e308f13
)
pull/3250/head
parent
ee1b6dd83c
commit
75c9130865
|
@ -398,7 +398,7 @@
|
|||
delegate_to: "{{ groups[mon_group_name][0] }}"
|
||||
when:
|
||||
- (ceph_versions.get('stdout', '{}')|from_json).get('osd', {}) | length == 1
|
||||
- ceph_versions_osd | string | search("ceph version 10")
|
||||
- ceph_versions_osd | string is search("ceph version 10")
|
||||
- not jewel_minor_update
|
||||
|
||||
- name: get num_pgs - non container
|
||||
|
@ -467,7 +467,7 @@
|
|||
delegate_to: "{{ groups[mon_group_name][0] }}"
|
||||
when:
|
||||
- (ceph_versions.get('stdout', '{}')|from_json).get('osd', {}) | length == 1
|
||||
- ceph_versions_osd | string | search("ceph version 12")
|
||||
- ceph_versions_osd | string is search("ceph version 12")
|
||||
- not jewel_minor_update
|
||||
|
||||
|
||||
|
|
|
@ -76,17 +76,17 @@
|
|||
- name: set_fact ceph_uid for ubuntu
|
||||
set_fact:
|
||||
ceph_uid: 64045
|
||||
when: ceph_docker_image_tag | search("ubuntu")
|
||||
when: ceph_docker_image_tag is search("ubuntu")
|
||||
|
||||
- name: set_fact ceph_uid for red hat
|
||||
set_fact:
|
||||
ceph_uid: 167
|
||||
when: ceph_docker_image_tag | match("latest") or ceph_docker_image_tag | search("centos") or ceph_docker_image_tag | search("fedora")
|
||||
when: ceph_docker_image_tag is match("latest") or ceph_docker_image_tag is search("centos") or ceph_docker_image_tag is search("fedora")
|
||||
|
||||
- name: set_fact ceph_uid for rhel
|
||||
set_fact:
|
||||
ceph_uid: 167
|
||||
when: ceph_docker_image | search("rhceph")
|
||||
when: ceph_docker_image is search("rhceph")
|
||||
|
||||
- name: set proper ownership on ceph directories
|
||||
file:
|
||||
|
@ -158,11 +158,11 @@
|
|||
|
||||
- set_fact:
|
||||
ceph_uid: 64045
|
||||
when: ceph_docker_image_tag | match("latest") or ceph_docker_image_tag | search("ubuntu")
|
||||
when: ceph_docker_image_tag is match("latest") or ceph_docker_image_tag is search("ubuntu")
|
||||
|
||||
- set_fact:
|
||||
ceph_uid: 167
|
||||
when: ceph_docker_image_tag | search("centos") or ceph_docker_image | search("rhceph") or ceph_docker_image_tag | search("fedora")
|
||||
when: ceph_docker_image_tag is search("centos") or ceph_docker_image is search("rhceph") or ceph_docker_image_tag is search("fedora")
|
||||
|
||||
- name: set proper ownership on ceph directories
|
||||
file:
|
||||
|
@ -229,17 +229,17 @@
|
|||
|
||||
- set_fact:
|
||||
ceph_uid: 64045
|
||||
when: ceph_docker_image_tag | match("latest") or ceph_docker_image_tag | search("ubuntu")
|
||||
when: ceph_docker_image_tag is match("latest") or ceph_docker_image_tag is search("ubuntu")
|
||||
|
||||
- name: set_fact ceph_uid for red hat
|
||||
set_fact:
|
||||
ceph_uid: 167
|
||||
when: ceph_docker_image_tag | match("latest") or ceph_docker_image_tag | search("centos") or ceph_docker_image_tag | search("fedora")
|
||||
when: ceph_docker_image_tag is match("latest") or ceph_docker_image_tag is search("centos") or ceph_docker_image_tag is search("fedora")
|
||||
|
||||
- name: set_fact ceph_uid for rhel
|
||||
set_fact:
|
||||
ceph_uid: 167
|
||||
when: ceph_docker_image | search("rhceph")
|
||||
when: ceph_docker_image is search("rhceph")
|
||||
|
||||
- name: set proper ownership on ceph directories
|
||||
file:
|
||||
|
@ -333,11 +333,11 @@
|
|||
|
||||
- set_fact:
|
||||
ceph_uid: 64045
|
||||
when: ceph_docker_image_tag | match("latest") or ceph_docker_image_tag | search("ubuntu")
|
||||
when: ceph_docker_image_tag is match("latest") or ceph_docker_image_tag is search("ubuntu")
|
||||
|
||||
- set_fact:
|
||||
ceph_uid: 167
|
||||
when: ceph_docker_image_tag | search("centos") or ceph_docker_image | search("rhceph") or ceph_docker_image_tag | search("fedora")
|
||||
when: ceph_docker_image_tag is search("centos") or ceph_docker_image is search("rhceph") or ceph_docker_image_tag is search("fedora")
|
||||
|
||||
- name: set proper ownership on ceph directories
|
||||
file:
|
||||
|
@ -375,11 +375,11 @@
|
|||
|
||||
- set_fact:
|
||||
ceph_uid: 64045
|
||||
when: ceph_docker_image_tag | match("latest") or ceph_docker_image_tag | search("ubuntu")
|
||||
when: ceph_docker_image_tag is match("latest") or ceph_docker_image_tag is search("ubuntu")
|
||||
|
||||
- set_fact:
|
||||
ceph_uid: 167
|
||||
when: ceph_docker_image_tag | search("centos") or ceph_docker_image | search("rhceph") or ceph_docker_image_tag | search("fedora")
|
||||
when: ceph_docker_image_tag is search("centos") or ceph_docker_image is search("rhceph") or ceph_docker_image_tag is search("fedora")
|
||||
|
||||
- name: set proper ownership on ceph directories
|
||||
file:
|
||||
|
@ -417,11 +417,11 @@
|
|||
|
||||
- set_fact:
|
||||
ceph_uid: 64045
|
||||
when: ceph_docker_image_tag | match("latest") or ceph_docker_image_tag | search("ubuntu")
|
||||
when: ceph_docker_image_tag is match("latest") or ceph_docker_image_tag is search("ubuntu")
|
||||
|
||||
- set_fact:
|
||||
ceph_uid: 167
|
||||
when: ceph_docker_image_tag | search("centos") or ceph_docker_image | search("rhceph") or ceph_docker_image_tag | search("fedora")
|
||||
when: ceph_docker_image_tag is search("centos") or ceph_docker_image is search("rhceph") or ceph_docker_image_tag is search("fedora")
|
||||
|
||||
- name: set proper ownership on ceph directories
|
||||
file:
|
||||
|
@ -463,11 +463,11 @@
|
|||
|
||||
- set_fact:
|
||||
ceph_uid: 64045
|
||||
when: ceph_docker_image_tag | match("latest") or ceph_docker_image_tag | search("ubuntu")
|
||||
when: ceph_docker_image_tag is match("latest") or ceph_docker_image_tag is search("ubuntu")
|
||||
|
||||
- set_fact:
|
||||
ceph_uid: 167
|
||||
when: ceph_docker_image_tag | search("centos") or ceph_docker_image | search("rhceph") or ceph_docker_image_tag | search("fedora")
|
||||
when: ceph_docker_image_tag is search("centos") or ceph_docker_image is search("rhceph") or ceph_docker_image_tag is search("fedora")
|
||||
|
||||
- name: set proper ownership on ceph directories
|
||||
file:
|
||||
|
|
|
@ -23,7 +23,7 @@
|
|||
when:
|
||||
- ansible_distribution == 'Red Hat Enterprise Linux'
|
||||
- ceph_repository == 'rhcs'
|
||||
- ansible_distribution_version | version_compare('7.3', '<')
|
||||
- ansible_distribution_version is version_compare('7.3', '<')
|
||||
|
||||
- name: determine if node is registered with subscription-manager
|
||||
command: subscription-manager identity
|
||||
|
@ -57,7 +57,7 @@
|
|||
msg: "Distribution not supported: {{ ansible_distribution }}"
|
||||
when:
|
||||
- ansible_distribution == 'openSUSE Leap'
|
||||
- ansible_distribution_version | version_compare('42.3', '<')
|
||||
- ansible_distribution_version is version_compare('42.3', '<')
|
||||
|
||||
- name: fail on unsupported ansible version
|
||||
fail:
|
||||
|
|
|
@ -3,28 +3,28 @@
|
|||
set_fact:
|
||||
ceph_release: jewel
|
||||
when:
|
||||
- ceph_version.split('.')[0] | version_compare('10', '==')
|
||||
- ceph_version.split('.')[0] is version_compare('10', '==')
|
||||
|
||||
- name: set_fact ceph_release kraken
|
||||
set_fact:
|
||||
ceph_release: kraken
|
||||
when:
|
||||
- ceph_version.split('.')[0] | version_compare('11', '==')
|
||||
- ceph_version.split('.')[0] is version_compare('11', '==')
|
||||
|
||||
- name: set_fact ceph_release luminous
|
||||
set_fact:
|
||||
ceph_release: luminous
|
||||
when:
|
||||
- ceph_version.split('.')[0] | version_compare('12', '==')
|
||||
- ceph_version.split('.')[0] is version_compare('12', '==')
|
||||
|
||||
- name: set_fact ceph_release mimic
|
||||
set_fact:
|
||||
ceph_release: mimic
|
||||
when:
|
||||
- ceph_version.split('.')[0] | version_compare('13', '==')
|
||||
- ceph_version.split('.')[0] is version_compare('13', '==')
|
||||
|
||||
- name: set_fact ceph_release nautilus
|
||||
set_fact:
|
||||
ceph_release: nautilus
|
||||
when:
|
||||
- ceph_version.split('.')[0] | version_compare('14', '==')
|
||||
- ceph_version.split('.')[0] is version_compare('14', '==')
|
||||
|
|
|
@ -206,21 +206,21 @@
|
|||
ceph_uid: 64045
|
||||
when:
|
||||
- containerized_deployment
|
||||
- ceph_docker_image_tag | search("ubuntu")
|
||||
- ceph_docker_image_tag is search("ubuntu")
|
||||
|
||||
- name: set_fact ceph_uid for red hat based system - container
|
||||
set_fact:
|
||||
ceph_uid: 167
|
||||
when:
|
||||
- containerized_deployment
|
||||
- ceph_docker_image_tag | search("latest") or ceph_docker_image_tag | search("centos") or ceph_docker_image_tag | search("fedora")
|
||||
- ceph_docker_image_tag is search("latest") or ceph_docker_image_tag is search("centos") or ceph_docker_image_tag is search("fedora")
|
||||
|
||||
- name: set_fact ceph_uid for red hat
|
||||
set_fact:
|
||||
ceph_uid: 167
|
||||
when:
|
||||
- containerized_deployment
|
||||
- ceph_docker_image | search("rhceph")
|
||||
- ceph_docker_image is search("rhceph")
|
||||
|
||||
- name: set_fact rgw_hostname
|
||||
set_fact:
|
||||
|
|
|
@ -3,28 +3,28 @@
|
|||
set_fact:
|
||||
ceph_release: jewel
|
||||
when:
|
||||
- ceph_version.split('.')[0] | version_compare('10', '==')
|
||||
- ceph_version.split('.')[0] is version_compare('10', '==')
|
||||
|
||||
- name: set_fact ceph_release kraken
|
||||
set_fact:
|
||||
ceph_release: kraken
|
||||
when:
|
||||
- ceph_version.split('.')[0] | version_compare('11', '==')
|
||||
- ceph_version.split('.')[0] is version_compare('11', '==')
|
||||
|
||||
- name: set_fact ceph_release luminous
|
||||
set_fact:
|
||||
ceph_release: luminous
|
||||
when:
|
||||
- ceph_version.split('.')[0] | version_compare('12', '==')
|
||||
- ceph_version.split('.')[0] is version_compare('12', '==')
|
||||
|
||||
- name: set_fact ceph_release mimic
|
||||
set_fact:
|
||||
ceph_release: mimic
|
||||
when:
|
||||
- ceph_version.split('.')[0] | version_compare('13', '==')
|
||||
- ceph_version.split('.')[0] is version_compare('13', '==')
|
||||
|
||||
- name: set_fact ceph_release nautilus
|
||||
set_fact:
|
||||
ceph_release: nautilus
|
||||
when:
|
||||
- ceph_version.split('.')[0] | version_compare('14', '==')
|
||||
- ceph_version.split('.')[0] is version_compare('14', '==')
|
||||
|
|
|
@ -8,7 +8,7 @@ ExecStartPre=-/usr/bin/docker stop ceph-mds-{{ ansible_hostname }}
|
|||
ExecStartPre=-/usr/bin/docker rm ceph-mds-{{ ansible_hostname }}
|
||||
ExecStart=/usr/bin/docker run --rm --net=host \
|
||||
--memory={{ ceph_mds_docker_memory_limit }} \
|
||||
{% if ceph_docker_version.split('.')[0] | version_compare('13', '>=') -%}
|
||||
{% if ceph_docker_version.split('.')[0] is version_compare('13', '>=') -%}
|
||||
--cpus={{ ceph_mds_docker_cpu_limit }} \
|
||||
{% else -%}
|
||||
--cpu-quota={{ ceph_mds_docker_cpu_limit * 100000 }} \
|
||||
|
|
|
@ -8,7 +8,7 @@ ExecStartPre=-/usr/bin/docker stop ceph-mgr-{{ ansible_hostname }}
|
|||
ExecStartPre=-/usr/bin/docker rm ceph-mgr-{{ ansible_hostname }}
|
||||
ExecStart=/usr/bin/docker run --rm --net=host \
|
||||
--memory={{ ceph_mgr_docker_memory_limit }} \
|
||||
{% if ceph_docker_version.split('.')[0] | version_compare('13', '>=') -%}
|
||||
{% if ceph_docker_version.split('.')[0] is version_compare('13', '>=') -%}
|
||||
--cpus={{ ceph_mgr_docker_cpu_limit }} \
|
||||
{% else -%}
|
||||
--cpu-quota={{ ceph_mgr_docker_cpu_limit * 100000 }} \
|
||||
|
|
|
@ -43,4 +43,4 @@
|
|||
- "{{ statconfig.results }}"
|
||||
when:
|
||||
- item.1.stat.exists == true
|
||||
- item.0 | search("keyring")
|
||||
- item.0 is search("keyring")
|
||||
|
|
|
@ -8,7 +8,7 @@ ExecStartPre=-/usr/bin/docker rm ceph-mon-%i
|
|||
ExecStartPre=$(command -v mkdir) -p /etc/ceph /var/lib/ceph/mon
|
||||
ExecStart=/usr/bin/docker run --rm --name ceph-mon-%i \
|
||||
--memory={{ ceph_mon_docker_memory_limit }} \
|
||||
{% if ceph_docker_version.split('.')[0] | version_compare('13', '>=') -%}
|
||||
{% if ceph_docker_version.split('.')[0] is version_compare('13', '>=') -%}
|
||||
--cpus={{ ceph_mon_docker_cpu_limit }} \
|
||||
{% else -%}
|
||||
--cpu-quota={{ ceph_mon_docker_cpu_limit * 100000 }} \
|
||||
|
|
|
@ -61,7 +61,7 @@ expose_partitions "$1"
|
|||
--privileged=true \
|
||||
--pid=host \
|
||||
--memory={{ ceph_osd_docker_memory_limit }} \
|
||||
{% if ceph_docker_version.split('.')[0] | version_compare('13', '>=') -%}
|
||||
{% if ceph_docker_version.split('.')[0] is version_compare('13', '>=') -%}
|
||||
--cpus={{ ceph_osd_docker_cpu_limit }} \
|
||||
{% else -%}
|
||||
--cpu-quota={{ ceph_osd_docker_cpu_limit * 100000 }} \
|
||||
|
|
|
@ -8,7 +8,7 @@ ExecStartPre=-/usr/bin/docker stop ceph-rbd-mirror-{{ ansible_hostname }}
|
|||
ExecStartPre=-/usr/bin/docker rm ceph-rbd-mirror-{{ ansible_hostname }}
|
||||
ExecStart=/usr/bin/docker run --rm --net=host \
|
||||
--memory={{ ceph_rbd_mirror_docker_memory_limit }} \
|
||||
{% if ceph_docker_version.split('.')[0] | version_compare('13', '>=') -%}
|
||||
{% if ceph_docker_version.split('.')[0] is version_compare('13', '>=') -%}
|
||||
--cpus={{ ceph_rbd_mirror_docker_cpu_limit }} \
|
||||
{% else -%}
|
||||
--cpu-quota={{ ceph_rbd_mirror_docker_cpu_limit * 100000 }} \
|
||||
|
|
|
@ -8,7 +8,7 @@ ExecStartPre=-/usr/bin/docker stop ceph-rgw-{{ ansible_hostname }}
|
|||
ExecStartPre=-/usr/bin/docker rm ceph-rgw-{{ ansible_hostname }}
|
||||
ExecStart=/usr/bin/docker run --rm --net=host \
|
||||
--memory={{ ceph_rgw_docker_memory_limit }} \
|
||||
{% if ceph_docker_version.split('.')[0] | version_compare('13', '>=') -%}
|
||||
{% if ceph_docker_version.split('.')[0] is version_compare('13', '>=') -%}
|
||||
--cpus={{ ceph_rgw_docker_cpu_limit }} \
|
||||
{% else -%}
|
||||
--cpu-quota={{ ceph_rgw_docker_cpu_limit * 100000 }} \
|
||||
|
|
Loading…
Reference in New Issue