]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph-ansible.git/commitdiff
ceph-mon: use interactive session with aliases
authorDimitri Savineau <dsavinea@redhat.com>
Tue, 4 Feb 2020 16:31:47 +0000 (11:31 -0500)
committerGuillaume Abrioux <gabrioux@redhat.com>
Wed, 5 Feb 2020 14:29:51 +0000 (15:29 +0100)
When using ceph aliases with commands that require manual intervention
to stop then the command will keep running inside the container (like
using Ctrl+c).
For handling this, we should use the interactive session option (-it)
with the docker commands.

Closes: https://bugzilla.redhat.com/show_bug.cgi?id=1797874
Signed-off-by: Dimitri Savineau <dsavinea@redhat.com>
roles/ceph-mon/templates/ceph-aliases.sh.j2

index 4873233af36fdc156dc15b155be884f2819ae482..c6dd69fde7f85c9c19e9393f290d15ce30026ebf 100644 (file)
@@ -1,17 +1,17 @@
 #!/bin/bash
 # Sets up handy aliases for ceph.
 ceph() {
-  sudo {{ docker_exec_cmd }} ceph --cluster {{ cluster }} ${@}
+  sudo docker exec -it ceph-mon-{{ ansible_hostname }} ceph --cluster {{ cluster }} ${@}
 }
 
 radosgw-admin() {
-  sudo {{ docker_exec_cmd }} radosgw-admin --cluster {{ cluster }} ${@}
+  sudo docker exec -it ceph-mon-{{ ansible_hostname }} radosgw-admin --cluster {{ cluster }} ${@}
 }
 
 rados() {
-  sudo {{ docker_exec_cmd }} rados --cluster {{ cluster }} ${@}
+  sudo docker exec -it ceph-mon-{{ ansible_hostname }} rados --cluster {{ cluster }} ${@}
 }
 
 rbd() {
-  sudo {{ docker_exec_cmd }} rbd --cluster {{ cluster }} ${@}
+  sudo docker exec -it ceph-mon-{{ ansible_hostname }} rbd --cluster {{ cluster }} ${@}
 }