]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph-ansible.git/commitdiff
default: look for the right return code on socket stat in-use
authorSébastien Han <seb@redhat.com>
Thu, 14 Dec 2017 10:31:28 +0000 (11:31 +0100)
committerSébastien Han <seb@redhat.com>
Tue, 19 Dec 2017 12:37:52 +0000 (13:37 +0100)
As reported in https://github.com/ceph/ceph-ansible/issues/2254, the
check with fuser is not ideal. If fuser is not available the return code
is 127. Here we want to make sure that we looking for the correct return
code, so 1.

Closes: https://github.com/ceph/ceph-ansible/issues/2254
Signed-off-by: Sébastien Han <seb@redhat.com>
(cherry picked from commit 7eaf444328c8c381c673883913cf71b8ebe9d064)
Signed-off-by: Sébastien Han <seb@redhat.com>
roles/ceph-defaults/tasks/check_socket_non_container.yml

index 4ad560ad0be4b7d42fe7a2e2679816f931956912..a7dbe6a6731fe84c1d5dcd2df7f4f56868370344 100644 (file)
@@ -25,7 +25,7 @@
   when:
     - inventory_hostname in groups.get(mon_group_name, [])
     - mon_socket_stat.rc == 0
-    - mon_socket.rc != 0
+    - mon_socket.rc == 1
 
 - name: check for a ceph osd socket
   shell: |
@@ -54,7 +54,7 @@
   when:
     - inventory_hostname in groups.get(osd_group_name, [])
     - osd_socket_stat.rc == 0
-    - osd_socket.rc != 0
+    - osd_socket.rc == 1
 
 - name: check for a ceph mds socket
   shell: |
@@ -83,7 +83,7 @@
   when:
     - inventory_hostname in groups.get(mds_group_name, [])
     - mds_socket_stat.rc == 0
-    - mds_socket.rc != 0
+    - mds_socket.rc == 1
 
 - name: check for a ceph rgw socket
   shell: |
   when:
     - inventory_hostname in groups.get(rgw_group_name, [])
     - rgw_socket_stat.rc == 0
-    - rgw_socket.rc != 0
+    - rgw_socket.rc == 1
 
 - name: check for a ceph mgr socket
   shell: |
   when:
     - inventory_hostname in groups.get(mgr_group_name, [])
     - mgr_socket_stat.rc == 0
-    - mgr_socket.rc != 0
+    - mgr_socket.rc == 1
 
 - name: check for a ceph rbd mirror socket
   shell: |
   when:
     - inventory_hostname in groups.get(rbdmirror_group_name, [])
     - rbd_mirror_socket_stat.rc == 0
-    - rbd_mirror_socket.rc != 0
+    - rbd_mirror_socket.rc == 1
 
 - name: check for a ceph nfs ganesha socket
   command: stat --printf=%n /var/run/ganesha.pid
   when:
     - inventory_hostname in groups.get(nfs_group_name, [])
     - nfs_socket_stat.rc == 0
-    - nfs_socket.rc != 0
+    - nfs_socket.rc == 1