From: Noah Watkins Date: Fri, 5 Oct 2018 22:56:45 +0000 (-0700) Subject: Stringify ceph_docker_image_tag X-Git-Tag: v3.2.0beta4~5 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=8dcc8d1434dbe2837d91162f4647246c54826e97;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 --- 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 f9ec87c1f..296edd446 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: @@ -159,11 +159,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: @@ -231,12 +231,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: @@ -336,11 +336,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: @@ -379,11 +379,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: @@ -422,11 +422,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: @@ -469,11 +469,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 bfa4aafee..ab899d648 100644 --- a/roles/ceph-defaults/tasks/facts.yml +++ b/roles/ceph-defaults/tasks/facts.yml @@ -209,14 +209,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: