ceph-ansible/roles
Dimitri Savineau fbf4ed42ae 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:51:29 -04:00
..
ceph-client ansible: use 'bool' filter on boolean conditionals 2019-06-07 16:05:51 +02:00
ceph-common Change ansible_lsb by ansible_distribution_release 2019-06-21 13:36:15 -04:00
ceph-config tests: Update ansible ssh_args variable 2019-06-17 16:45:38 +02:00
ceph-container-common ansible: use 'bool' filter on boolean conditionals 2019-06-07 16:05:51 +02:00
ceph-container-engine container-common: support podman on Ubuntu 2019-06-07 10:12:36 -04:00
ceph-dashboard dashboard: fix dashboard_url setting 2019-06-12 17:04:57 -04:00
ceph-defaults Change ansible_lsb by ansible_distribution_release 2019-06-21 13:36:15 -04:00
ceph-facts facts: add a retry on get current fsid task 2019-06-20 14:01:33 -04:00
ceph-fetch-keys meta: set the right minimum ansible version required for galaxy 2018-12-11 09:59:25 +01:00
ceph-grafana dashboard: add allow_embedding support 2019-06-12 17:05:26 -04:00
ceph-handler ceph-handler: Fix OSD restart script 2019-06-21 14:51:29 -04:00
ceph-infra ceph-infra: make chronyd default NTP daemon 2019-06-14 12:21:02 +00:00
ceph-iscsi-gw roles: Remove useless become (true) flag 2019-06-20 22:00:27 +00:00
ceph-mds align cephfs pool creation 2019-06-18 09:17:13 +02:00
ceph-mgr roles: Remove useless become (true) flag 2019-06-20 22:00:27 +00:00
ceph-mon roles: Remove useless become (true) flag 2019-06-20 22:00:27 +00:00
ceph-nfs Change ansible_lsb by ansible_distribution_release 2019-06-21 13:36:15 -04:00
ceph-node-exporter ceph-node-exporter: Fix systemd template 2019-06-13 07:37:26 +02:00
ceph-osd ceph-volume: Set max open files limit on container 2019-06-20 20:00:53 -04:00
ceph-prometheus Fix units and add ability to have a dedicated instance 2019-06-12 11:48:12 +02:00
ceph-rbd-mirror roles: Remove useless become (true) flag 2019-06-20 22:00:27 +00:00
ceph-rgw roles: Remove useless become (true) flag 2019-06-20 22:00:27 +00:00
ceph-rgw-loadbalancer Add role definitions of ceph-rgw-loadbalancer 2019-06-06 19:44:30 +00:00
ceph-validate validate: fail in check_devices at the right task 2019-06-10 08:11:39 +02:00