ceph-ansible/roles
Dimitri Savineau 2b492e3de1 ceph-handler: Fix OSD restart script
There's two big issues with the current OSD restart script.

1/ We try to test if the ceph osd daemon socket exists but we use a
wildcard for the socket name : /var/run/ceph/*.asok.
This fails because we usually have multiple ceph osd sockets (or
other ceph daemon collocated) present in /var/run/ceph directory.
Currently the test fails with:

bash: line xxx: [: too many arguments

But it doesn't stop the script execution.
Instead we can specify the full ceph osd socket name because we
already know the OSD id.

2/ The container filter pattern is wrong and could matches multiple
containers resulting the script to fail.
We use the filter with two different patterns. One is with the device
name (sda, sdb, ..) and the other one is with the OSD id (ceph-osd-0,
ceph-osd-15, ..).
In both case we could match more than needed.

$ docker container ls
CONTAINER ID IMAGE              NAMES
958121a7cc7d ceph-daemon:latest ceph-osd-strg0-sda
589a982d43b5 ceph-daemon:latest ceph-osd-strg0-sdb
46c7240d71f3 ceph-daemon:latest ceph-osd-strg0-sdaa
877985ec3aca ceph-daemon:latest ceph-osd-strg0-sdab
$ docker container ls -q -f "name=sda"
958121a7cc7d
46c7240d71f3
877985ec3aca

$ docker container ls
CONTAINER ID IMAGE              NAMES
2db399b3ee85 ceph-daemon:latest ceph-osd-5
099dc13f08f1 ceph-daemon:latest ceph-osd-13
5d0c2fe8f121 ceph-daemon:latest ceph-osd-17
d6c7b89db1d1 ceph-daemon:latest ceph-osd-1
$ docker container ls -q -f "name=ceph-osd-1"
099dc13f08f1
5d0c2fe8f121
d6c7b89db1d1

Adding an extra '$' character at the end of the pattern solves the
problem.

Finally removing the get_container_osd_id function because it's not
used in the script at all.

Signed-off-by: Dimitri Savineau <dsavinea@redhat.com>
(cherry picked from commit 45d46541cb)
2019-06-21 14:49:55 -04:00
..
ceph-agent remove ceph-agent role and references 2019-06-17 14:42:08 -04:00
ceph-client remove all NBSPs char in stable-3.2 branch 2019-04-10 13:27:48 +02:00
ceph-common remove all NBSPs char in stable-3.2 branch 2019-04-10 13:27:48 +02:00
ceph-common-coreos don't use "include" to include tasks 2018-09-27 17:53:40 +02:00
ceph-config tests: Update ansible ssh_args variable 2019-06-17 12:02:36 -04:00
ceph-defaults ceph-infra: make chronyd default NTP daemon 2019-06-18 10:46:34 +02:00
ceph-docker-common validate: change default value for `radosgw_address` 2018-11-28 23:54:06 +01:00
ceph-facts ceph-infra: make chronyd default NTP daemon 2019-06-18 10:46:34 +02:00
ceph-fetch-keys ceph-fetch-keys: refact 2018-10-17 11:26:11 +00:00
ceph-handler ceph-handler: Fix OSD restart script 2019-06-21 14:49:55 -04:00
ceph-infra ceph-infra: make chronyd default NTP daemon 2019-06-18 10:46:34 +02:00
ceph-iscsi-gw iscsi: assign application (rbd) to pool 'rbd' 2019-06-13 14:43:25 +02:00
ceph-mds update default rhcs values and docs 2019-06-04 14:18:23 +02:00
ceph-mgr update default rhcs values and docs 2019-06-04 14:18:23 +02:00
ceph-mon update default rhcs values and docs 2019-06-04 14:18:23 +02:00
ceph-nfs remove all NBSPs char in stable-3.2 branch 2019-04-10 13:27:48 +02:00
ceph-osd ceph-volume: Set max open files limit on container 2019-06-20 20:01:13 -04:00
ceph-rbd-mirror update default rhcs values and docs 2019-06-04 14:18:23 +02:00
ceph-restapi Change docker_container parameter network to network_mode 2019-03-18 13:23:10 +00:00
ceph-rgw update default rhcs values and docs 2019-06-04 14:18:23 +02:00
ceph-validate/tasks don't install NTPd on Atomic 2019-06-18 10:46:34 +02:00
ceph.ceph-common rollback previous change for ceph-common change 2016-03-02 18:44:36 +01:00
ceph.ceph-docker-common ceph-docker-common: add symlink to ceph.ceph-docker-common 2017-01-16 10:42:42 -06:00