]> 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>
Fri, 9 Oct 2020 11:55:28 +0000 (13:55 +0200)
commitd258bf4d2de2fd38444a31b76111f13c325bba06
treea0e04ce3ea7fc4cdfd8eabaacc618e9b1a6592b5
parentc733af9d43e572c97f301e7f704676f2ea5660dc
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