From: Noah Watkins Date: Fri, 5 Oct 2018 22:56:45 +0000 (-0700) Subject: Stringify ceph_docker_image_tag X-Git-Tag: v3.1.9~2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=e089f46607a2d1071160cace2e8acabca6187864;p=ceph-ansible.git Stringify ceph_docker_image_tag This could be a numeric input, but is treated like a string leading to runtime errors. Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=1635823 Signed-off-by: Noah Watkins (cherry picked from commit 8dcc8d1434dbe2837d91162f4647246c54826e97) --- diff --git a/infrastructure-playbooks/switch-from-non-containerized-to-containerized-ceph-daemons.yml b/infrastructure-playbooks/switch-from-non-containerized-to-containerized-ceph-daemons.yml index c8e041a54..535258cb0 100644 --- a/infrastructure-playbooks/switch-from-non-containerized-to-containerized-ceph-daemons.yml +++ b/infrastructure-playbooks/switch-from-non-containerized-to-containerized-ceph-daemons.yml @@ -76,12 +76,12 @@ - name: set_fact ceph_uid for ubuntu set_fact: ceph_uid: 64045 - when: ceph_docker_image_tag is search("ubuntu") + when: ceph_docker_image_tag | string is search("ubuntu") - name: set_fact ceph_uid for red hat set_fact: ceph_uid: 167 - when: ceph_docker_image_tag is match("latest") or ceph_docker_image_tag is search("centos") or ceph_docker_image_tag is search("fedora") + when: ceph_docker_image_tag | string is match("latest") or ceph_docker_image_tag | string is search("centos") or ceph_docker_image_tag | string is search("fedora") - name: set_fact ceph_uid for rhel set_fact: @@ -158,11 +158,11 @@ - set_fact: ceph_uid: 64045 - when: ceph_docker_image_tag is match("latest") or ceph_docker_image_tag is search("ubuntu") + when: ceph_docker_image_tag | string is match("latest") or ceph_docker_image_tag | string is search("ubuntu") - set_fact: ceph_uid: 167 - when: ceph_docker_image_tag is search("centos") or ceph_docker_image is search("rhceph") or ceph_docker_image_tag is search("fedora") + when: ceph_docker_image_tag | string is search("centos") or ceph_docker_image is search("rhceph") or ceph_docker_image_tag | string is search("fedora") - name: set proper ownership on ceph directories file: @@ -229,12 +229,12 @@ - set_fact: ceph_uid: 64045 - when: ceph_docker_image_tag is match("latest") or ceph_docker_image_tag is search("ubuntu") + when: ceph_docker_image_tag | string is match("latest") or ceph_docker_image_tag | string is search("ubuntu") - name: set_fact ceph_uid for red hat set_fact: ceph_uid: 167 - when: ceph_docker_image_tag is match("latest") or ceph_docker_image_tag is search("centos") or ceph_docker_image_tag is search("fedora") + when: ceph_docker_image_tag | string is match("latest") or ceph_docker_image_tag | string is search("centos") or ceph_docker_image_tag | string is search("fedora") - name: set_fact ceph_uid for rhel set_fact: @@ -333,11 +333,11 @@ - set_fact: ceph_uid: 64045 - when: ceph_docker_image_tag is match("latest") or ceph_docker_image_tag is search("ubuntu") + when: ceph_docker_image_tag | string is match("latest") or ceph_docker_image_tag | string is search("ubuntu") - set_fact: ceph_uid: 167 - when: ceph_docker_image_tag is search("centos") or ceph_docker_image is search("rhceph") or ceph_docker_image_tag is search("fedora") + when: ceph_docker_image_tag | string is search("centos") or ceph_docker_image is search("rhceph") or ceph_docker_image_tag | string 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 is match("latest") or ceph_docker_image_tag is search("ubuntu") + when: ceph_docker_image_tag | string is match("latest") or ceph_docker_image_tag | string is search("ubuntu") - set_fact: ceph_uid: 167 - when: ceph_docker_image_tag is search("centos") or ceph_docker_image is search("rhceph") or ceph_docker_image_tag is search("fedora") + when: ceph_docker_image_tag | string is search("centos") or ceph_docker_image is search("rhceph") or ceph_docker_image_tag | string 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 is match("latest") or ceph_docker_image_tag is search("ubuntu") + when: ceph_docker_image_tag | string is match("latest") or ceph_docker_image_tag | string is search("ubuntu") - set_fact: ceph_uid: 167 - when: ceph_docker_image_tag is search("centos") or ceph_docker_image is search("rhceph") or ceph_docker_image_tag is search("fedora") + when: ceph_docker_image_tag | string is search("centos") or ceph_docker_image is search("rhceph") or ceph_docker_image_tag | string 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 is match("latest") or ceph_docker_image_tag is search("ubuntu") + when: ceph_docker_image_tag | string is match("latest") or ceph_docker_image_tag | string is search("ubuntu") - set_fact: ceph_uid: 167 - when: ceph_docker_image_tag is search("centos") or ceph_docker_image is search("rhceph") or ceph_docker_image_tag is search("fedora") + when: ceph_docker_image_tag | string is search("centos") or ceph_docker_image is search("rhceph") or ceph_docker_image_tag | string is search("fedora") - name: set proper ownership on ceph directories file: diff --git a/roles/ceph-defaults/tasks/facts.yml b/roles/ceph-defaults/tasks/facts.yml index 0992e8db2..93d49918f 100644 --- a/roles/ceph-defaults/tasks/facts.yml +++ b/roles/ceph-defaults/tasks/facts.yml @@ -206,14 +206,14 @@ ceph_uid: 64045 when: - containerized_deployment - - ceph_docker_image_tag is search("ubuntu") + - ceph_docker_image_tag | string 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 is search("latest") or ceph_docker_image_tag is search("centos") or ceph_docker_image_tag is search("fedora") + - ceph_docker_image_tag | string is search("latest") or ceph_docker_image_tag | string is search("centos") or ceph_docker_image_tag | string is search("fedora") - name: set_fact ceph_uid for red hat set_fact: