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 14be66e96..62bdcfac0 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 @@ -90,11 +90,11 @@ ceph_uid: 167 when: ceph_docker_image is search("rhceph") - # NOTE: changed from file module to raw chown command for performance reasons + # NOTE: changed from file module to raw find command for performance reasons # The file module has to run checks on current ownership of all directories and files. This is unnecessary # as in this case we know we want all owned by ceph user - name: set proper ownership on ceph directories - command: "chown -R {{ ceph_uid }} /var/lib/ceph /etc/ceph" + command: "find /var/lib/ceph /etc/ceph -not -( -user {{ ceph_uid }} -or -group {{ ceph_uid }} -) -execdir chown {{ ceph_uid }}:{{ ceph_uid }} {} +" changed_when: false - name: check for existing old leveldb file extension (ldb) @@ -181,11 +181,11 @@ ceph_uid: 167 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") - # NOTE: changed from file module to raw chown command for performance reasons + # NOTE: changed from file module to raw find command for performance reasons # The file module has to run checks on current ownership of all directories and files. This is unnecessary # as in this case we know we want all owned by ceph user - name: set proper ownership on ceph directories - command: "chown -R {{ ceph_uid }} /var/lib/ceph /etc/ceph" + command: "find /var/lib/ceph /etc/ceph -not -( -user {{ ceph_uid }} -or -group {{ ceph_uid }} -) -execdir chown {{ ceph_uid }}:{{ ceph_uid }} {} +" changed_when: false tasks: @@ -263,11 +263,11 @@ ceph_uid: 167 when: ceph_docker_image is search("rhceph") - # NOTE: changed from file module to raw chown command for performance reasons + # NOTE: changed from file module to raw find command for performance reasons # The file module has to run checks on current ownership of all directories and files. This is unnecessary # as in this case we know we want all owned by ceph user - name: set proper ownership on ceph directories - command: "chown --verbose -R {{ ceph_uid }} /var/lib/ceph /etc/ceph" + command: "find /var/lib/ceph /etc/ceph -not -( -user {{ ceph_uid }} -or -group {{ ceph_uid }} -) -execdir chown {{ ceph_uid }}:{{ ceph_uid }} {} +" changed_when: false - name: check for existing old leveldb file extension (ldb) @@ -377,11 +377,11 @@ ceph_uid: 167 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") - # NOTE: changed from file module to raw chown command for performance reasons + # NOTE: changed from file module to raw find command for performance reasons # The file module has to run checks on current ownership of all directories and files. This is unnecessary # as in this case we know we want all owned by ceph user - name: set proper ownership on ceph directories - command: "chown -R {{ ceph_uid }} /var/lib/ceph /etc/ceph" + command: "find /var/lib/ceph /etc/ceph -not -( -user {{ ceph_uid }} -or -group {{ ceph_uid }} -) -execdir chown {{ ceph_uid }}:{{ ceph_uid }} {} +" changed_when: false tasks: @@ -423,11 +423,11 @@ ceph_uid: 167 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") - # NOTE: changed from file module to raw chown command for performance reasons + # NOTE: changed from file module to raw find command for performance reasons # The file module has to run checks on current ownership of all directories and files. This is unnecessary # as in this case we know we want all owned by ceph user - name: set proper ownership on ceph directories - command: "chown -R {{ ceph_uid }} /var/lib/ceph /etc/ceph" + command: "find /var/lib/ceph /etc/ceph -not -( -user {{ ceph_uid }} -or -group {{ ceph_uid }} -) -execdir chown {{ ceph_uid }}:{{ ceph_uid }} {} +" changed_when: false tasks: @@ -495,11 +495,11 @@ ceph_uid: 167 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") - # NOTE: changed from file module to raw chown command for performance reasons + # NOTE: changed from file module to raw find command for performance reasons # The file module has to run checks on current ownership of all directories and files. This is unnecessary # as in this case we know we want all owned by ceph user - name: set proper ownership on ceph directories - command: "chown -R {{ ceph_uid }} /var/lib/ceph /etc/ceph" + command: "find /var/lib/ceph /etc/ceph -not -( -user {{ ceph_uid }} -or -group {{ ceph_uid }} -) -execdir chown {{ ceph_uid }}:{{ ceph_uid }} {} +" changed_when: false tasks: @@ -552,11 +552,11 @@ ceph_uid: 167 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") - # NOTE: changed from file module to raw chown command for performance reasons + # NOTE: changed from file module to raw find command for performance reasons # The file module has to run checks on current ownership of all directories and files. This is unnecessary # as in this case we know we want all owned by ceph user - name: set proper ownership on ceph directories - command: "chown -R {{ ceph_uid }} /var/lib/ceph /etc/ceph" + command: "find /var/lib/ceph /etc/ceph -not -( -user {{ ceph_uid }} -or -group {{ ceph_uid }} -) -execdir chown {{ ceph_uid }}:{{ ceph_uid }} {} +" changed_when: false tasks: