diff --git a/infrastructure-playbooks/purge-docker-cluster.yml b/infrastructure-playbooks/purge-docker-cluster.yml index cee8be7bf..8b31df9d4 100644 --- a/infrastructure-playbooks/purge-docker-cluster.yml +++ b/infrastructure-playbooks/purge-docker-cluster.yml @@ -469,6 +469,10 @@ tags: remove_img + - name: remove ceph aliases + file: + path: /etc/profile.d/ceph-aliases.sh + state: absent - name: remove installed packages diff --git a/roles/ceph-mon/tasks/docker/configure_ceph_command_aliases.yml b/roles/ceph-mon/tasks/docker/configure_ceph_command_aliases.yml new file mode 100644 index 000000000..dc7fc6efe --- /dev/null +++ b/roles/ceph-mon/tasks/docker/configure_ceph_command_aliases.yml @@ -0,0 +1,8 @@ +--- +- name: configure ceph profile.d aliases + template: + src: ceph-aliases.sh.j2 + dest: "/etc/profile.d/ceph-aliases.sh" + mode: 0755 + owner: root + group: root diff --git a/roles/ceph-mon/tasks/docker/main.yml b/roles/ceph-mon/tasks/docker/main.yml index 97d2911fa..0c0bb15f7 100644 --- a/roles/ceph-mon/tasks/docker/main.yml +++ b/roles/ceph-mon/tasks/docker/main.yml @@ -6,6 +6,9 @@ - name: include start_docker_monitor.yml include: start_docker_monitor.yml +- name: include configure_ceph_command_aliases.yml + include: configure_ceph_command_aliases.yml + - name: wait for monitor socket to exist command: "{{ docker_exec_cmd }} sh -c 'stat /var/run/ceph/{{ cluster }}-mon.{{ ansible_hostname }}.asok || stat /var/run/ceph/{{ cluster }}-mon.{{ ansible_fqdn }}.asok'" register: monitor_socket diff --git a/roles/ceph-mon/templates/ceph-aliases.sh.j2 b/roles/ceph-mon/templates/ceph-aliases.sh.j2 new file mode 100644 index 000000000..4873233af --- /dev/null +++ b/roles/ceph-mon/templates/ceph-aliases.sh.j2 @@ -0,0 +1,17 @@ +#!/bin/bash +# Sets up handy aliases for ceph. +ceph() { + sudo {{ docker_exec_cmd }} ceph --cluster {{ cluster }} ${@} +} + +radosgw-admin() { + sudo {{ docker_exec_cmd }} radosgw-admin --cluster {{ cluster }} ${@} +} + +rados() { + sudo {{ docker_exec_cmd }} rados --cluster {{ cluster }} ${@} +} + +rbd() { + sudo {{ docker_exec_cmd }} rbd --cluster {{ cluster }} ${@} +}