]> git.apps.os.sepia.ceph.com Git - ceph-ansible.git/commit
handler: refact check_socket_non_container
authorGuillaume Abrioux <gabrioux@redhat.com>
Tue, 6 Oct 2020 12:58:46 +0000 (14:58 +0200)
committerGuillaume Abrioux <gabrioux@redhat.com>
Wed, 14 Oct 2020 08:31:05 +0000 (10:31 +0200)
commit709deb90cc9a76cc51d784d7e4fd22dda243246f
tree99bc75512ff707b14898f9582863c20cfc63b163
parentbff21234303b9086dd8a352b52f2f47c5f3d2251
handler: refact check_socket_non_container

the `stat --printf=%n` returns something like following:

```
ok: [osd0] => changed=false
  cmd: |-
    stat --printf=%n /var/run/ceph/ceph-osd*.asok
  delta: '0:00:00.009388'
  end: '2020-10-06 06:18:28.109500'
  failed_when_result: false
  rc: 0
  start: '2020-10-06 06:18:28.100112'
  stderr: ''
  stderr_lines: <omitted>
  stdout: /var/run/ceph/ceph-osd.2.asok/var/run/ceph/ceph-osd.5.asok
  stdout_lines: <omitted>
```

it makes the next task "check if the ceph osd socket is in-use" grep
like this:

```
ok: [osd0] => changed=false
  cmd:
  - grep
  - -q
  - /var/run/ceph/ceph-osd.2.asok/var/run/ceph/ceph-osd.5.asok
  - /proc/net/unix
```

which will obviously fail because this path never exists. It makes the
OSD handler broken.

Let's use `find` module instead.

Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
(cherry picked from commit 46d4d97da9c6078a6c5ff60a39db4b4072fb902b)
roles/ceph-handler/tasks/check_socket_non_container.yml
roles/ceph-handler/tasks/main.yml