ceph-ansible/roles
Dimitri Savineau 45d46541cb 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>
2019-06-21 19:54:15 +02:00
..
ceph-client ansible: use 'bool' filter on boolean conditionals 2019-06-06 10:21:17 +02:00
ceph-common Change ansible_lsb by ansible_distribution_release 2019-06-21 11:55:05 -04:00
ceph-config tests: Update ansible ssh_args variable 2019-06-17 09:24:24 +02:00
ceph-container-common ansible: use 'bool' filter on boolean conditionals 2019-06-06 10:21:17 +02:00
ceph-container-engine ansible: use 'bool' filter on boolean conditionals 2019-06-06 10:21:17 +02:00
ceph-dashboard dashboard: fix dashboard_url setting 2019-06-12 15:59:58 +02:00
ceph-defaults Change ansible_lsb by ansible_distribution_release 2019-06-21 11:55:05 -04:00
ceph-facts facts: add a retry on get current fsid task 2019-06-20 13:13:04 -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 16:00:32 +02:00
ceph-handler ceph-handler: Fix OSD restart script 2019-06-21 19:54:15 +02:00
ceph-infra ceph-infra: make chronyd default NTP daemon 2019-06-13 14:53:22 -04:00
ceph-iscsi-gw roles: Remove useless become (true) flag 2019-06-19 10:31:32 +02:00
ceph-mds align cephfs pool creation 2019-06-13 09:44:05 +02:00
ceph-mgr roles: Remove useless become (true) flag 2019-06-19 10:31:32 +02:00
ceph-mon roles: Remove useless become (true) flag 2019-06-19 10:31:32 +02:00
ceph-nfs Change ansible_lsb by ansible_distribution_release 2019-06-21 11:55:05 -04:00
ceph-node-exporter ceph-node-exporter: Fix systemd template 2019-06-11 21:48:40 +02:00
ceph-osd ceph-volume: Set max open files limit on container 2019-06-20 22:37:40 +02:00
ceph-prometheus Fix units and add ability to have a dedicated instance 2019-06-10 18:18:46 +02:00
ceph-rbd-mirror roles: Remove useless become (true) flag 2019-06-19 10:31:32 +02:00
ceph-rgw roles: Remove useless become (true) flag 2019-06-19 10:31:32 +02:00
ceph-rgw-loadbalancer Add role definitions of ceph-rgw-loadbalancer 2019-06-06 17:12:04 +02:00
ceph-validate validate: fail in check_devices at the right task 2019-06-07 16:14:18 +02:00