Merge pull request #665 from PiotrProkop/ceph-osd-kv

Adding support for non atomic and non CoreOS machines for deploying containerized osds with kv backend
pull/673/head
Leseb 2016-04-01 13:16:22 +02:00
commit 9f2556315f
4 changed files with 52 additions and 12 deletions

View File

@ -6,7 +6,9 @@
failed_when: false failed_when: false
- include: checks.yml - include: checks.yml
when: ceph_health.rc != 0 and not osd_containerized_deployment_with_kv when:
ceph_health.rc != 0 and
not osd_containerized_deployment_with_kv
- name: check if it is Atomic host - name: check if it is Atomic host
stat: path=/run/ostree-booted stat: path=/run/ostree-booted

View File

@ -24,7 +24,9 @@
env: "OSD_DEVICE={{ item }},{{ ceph_osd_docker_prepare_env }}" env: "OSD_DEVICE={{ item }},{{ ceph_osd_docker_prepare_env }}"
volumes: "/var/lib/ceph:/var/lib/ceph,/etc/ceph:/etc/ceph,/dev/:/dev/" volumes: "/var/lib/ceph:/var/lib/ceph,/etc/ceph:/etc/ceph,/dev/:/dev/"
with_items: ceph_osd_docker_devices with_items: ceph_osd_docker_devices
when: ceph_osd_docker_prepare_env is defined and not osd_containerized_deployment_with_kv when:
ceph_osd_docker_prepare_env is defined and
not osd_containerized_deployment_with_kv
- name: prepare ceph osd disk with kv_store - name: prepare ceph osd disk with kv_store
docker: docker:
@ -38,7 +40,9 @@
env: "OSD_DEVICE={{ item }},KV_TYPE={{kv_type}},KV_IP={{kv_endpoint}},{{ ceph_osd_docker_prepare_env }}" env: "OSD_DEVICE={{ item }},KV_TYPE={{kv_type}},KV_IP={{kv_endpoint}},{{ ceph_osd_docker_prepare_env }}"
ignore_errors: true ignore_errors: true
with_items: ceph_osd_docker_devices with_items: ceph_osd_docker_devices
when: ceph_osd_docker_prepare_env is defined and osd_containerized_deployment_with_kv when:
ceph_osd_docker_prepare_env is defined and
osd_containerized_deployment_with_kv
# Use systemd to manage container on Atomic host # Use systemd to manage container on Atomic host
- name: generate systemd unit file - name: generate systemd unit file
@ -57,18 +61,24 @@
dest: /etc/systemd/system/multi-user.target.wants/ceph-osd@{{ item | basename }}.service dest: /etc/systemd/system/multi-user.target.wants/ceph-osd@{{ item | basename }}.service
state: link state: link
with_items: ceph_osd_docker_devices with_items: ceph_osd_docker_devices
when: is_atomic or ansible_os_family == 'CoreOS' when:
is_atomic or
ansible_os_family == 'CoreOS'
- name: enable systemd unit file for osd instance - name: enable systemd unit file for osd instance
shell: systemctl enable /etc/systemd/system/multi-user.target.wants/ceph-osd@{{ item | basename }}.service shell: systemctl enable /etc/systemd/system/multi-user.target.wants/ceph-osd@{{ item | basename }}.service
failed_when: false failed_when: false
changed_when: false changed_when: false
with_items: ceph_osd_docker_devices with_items: ceph_osd_docker_devices
when: is_atomic or ansible_os_family == 'CoreOS' when:
is_atomic or
ansible_os_family == 'CoreOS'
- name: reload systemd unit files - name: reload systemd unit files
shell: systemctl daemon-reload shell: systemctl daemon-reload
when: is_atomic or ansible_os_family == 'CoreOS' when:
is_atomic or
ansible_os_family == 'CoreOS'
- name: systemd start osd container - name: systemd start osd container
service: service:
@ -77,7 +87,9 @@
enabled: yes enabled: yes
changed_when: false changed_when: false
with_items: ceph_osd_docker_devices with_items: ceph_osd_docker_devices
when: is_atomic or ansible_os_family == 'CoreOS' when:
is_atomic or
ansible_os_family == 'CoreOS'
- name: run the ceph osd docker image - name: run the ceph osd docker image
docker: docker:
@ -90,4 +102,24 @@
env: "OSD_DEVICE={{ item }},{{ ceph_osd_docker_extra_env }}" env: "OSD_DEVICE={{ item }},{{ ceph_osd_docker_extra_env }}"
volumes: "/var/lib/ceph:/var/lib/ceph,/etc/ceph:/etc/ceph,/dev/:/dev/" volumes: "/var/lib/ceph:/var/lib/ceph,/etc/ceph:/etc/ceph,/dev/:/dev/"
with_items: ceph_osd_docker_devices with_items: ceph_osd_docker_devices
when: not is_atomic and ansible_os_family != 'CoreOS' when:
not is_atomic and
ansible_os_family != 'CoreOS' and
not osd_containerized_deployment_with_kv
- name: run the ceph osd docker image with kv
docker:
image: "{{ ceph_osd_docker_username }}/{{ ceph_osd_docker_imagename }}"
name: "{{ ansible_hostname }}-osd-{{ item | regex_replace('/', '') }}"
net: host
pid: host
state: running
privileged: yes
env: "KV_TYPE={{kv_type}},KV_IP={{kv_endpoint}},OSD_DEVICE={{ item }},{{ ceph_osd_docker_extra_env }}"
volumes: "/dev/:/dev/"
with_items: ceph_osd_docker_devices
when:
not is_atomic and
ansible_os_family != 'CoreOS' and
osd_containerized_deployment_with_kv

View File

@ -3,13 +3,19 @@
when: not osd_containerized_deployment when: not osd_containerized_deployment
- include: ./scenarios/journal_collocation.yml - include: ./scenarios/journal_collocation.yml
when: journal_collocation and not osd_containerized_deployment when:
journal_collocation and
not osd_containerized_deployment
- include: ./scenarios/raw_multi_journal.yml - include: ./scenarios/raw_multi_journal.yml
when: raw_multi_journal and not osd_containerized_deployment when:
raw_multi_journal and
not osd_containerized_deployment
- include: ./scenarios/osd_directory.yml - include: ./scenarios/osd_directory.yml
when: osd_directory and not osd_containerized_deployment when:
osd_directory and
not osd_containerized_deployment
- include: ./scenarios/bluestore.yml - include: ./scenarios/bluestore.yml
when: when: