Skip to content

Commit

Permalink
osd: manage legacy ceph-disk non-container startup
Browse files Browse the repository at this point in the history
The code is now able (again) to start osds that where configured with
ceph-disk on a non-container scenario.

Closes: #3388
Signed-off-by: Sébastien Han <seb@redhat.com>
  • Loading branch information
leseb committed Nov 29, 2018
1 parent 8d93007 commit 452069c
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions roles/ceph-osd/tasks/start_osds.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,12 @@
when:
- containerized_deployment

# this is for ceph-disk, the ceph-disk command is gone so we have to list /var/lib/ceph
- name: get osd ids
shell: |
ls /var/lib/ceph/osd/ | sed 's/.*-//'
register: osd_ids_non_container

- name: set_fact docker_exec_start_osd
set_fact:
docker_exec_start_osd: "{{ 'docker run --rm --privileged=true -v /run/lvm/lvmetad.socket:/run/lvm/lvmetad.socket -v /etc/ceph:/etc/ceph:z -v /dev:/dev --entrypoint=ceph-volume ' + ceph_docker_registry + '/' + ceph_docker_image + ':' + ceph_docker_image_tag if containerized_deployment else 'ceph-volume' }}"
Expand All @@ -58,11 +64,11 @@

- name: systemd start osd
systemd:
name: ceph-osd@{{ item | regex_replace('/dev/', '') if osd_scenario != 'lvm' else item }}
name: ceph-osd@{{ item | regex_replace('/dev/', '') if osd_scenario != 'lvm' and containerized_deployment else item }}
state: started
enabled: yes
daemon_reload: yes
with_items: "{{ devices if osd_scenario != 'lvm' else (ceph_osd_ids.stdout | from_json).keys() }}"
with_items: "{{ devices if osd_scenario != 'lvm' and containerized_deployment else (ceph_osd_ids.stdout | from_json).keys() if osd_scenario == 'lvm' and not containerized_deployment else osd_ids_non_container.stdout_lines }}"

- name: ensure systemd service override directory exists
file:
Expand Down

0 comments on commit 452069c

Please sign in to comment.