]> git.apps.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)
committerGuillaume Abrioux <gabrioux@redhat.com>
Thu, 14 Dec 2017 15:59:14 +0000 (16:59 +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>
roles/ceph-defaults/tasks/check_socket_non_container.yml

index fab68ebe6b92436aef092d7264a308e92e108526..3978523a3f61e8233017db38f24060d29623d232 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