2014-09-05 03:14:11 +08:00
|
|
|
---
|
2015-05-16 00:27:41 +08:00
|
|
|
# NOTE (leseb) : this task is for disk devices only because of the explicit use of the first
|
2014-09-05 03:14:11 +08:00
|
|
|
# partition.
|
2015-07-24 02:01:43 +08:00
|
|
|
- name: activate osd(s) when device is a disk
|
2015-10-19 09:24:47 +08:00
|
|
|
command: ceph-disk activate {{ item.1 | regex_replace('^(\/dev\/cciss\/c[0-9]{1}d[0-9]{1})$', '\\1p') }}1
|
2014-09-05 03:14:11 +08:00
|
|
|
with_together:
|
|
|
|
- ispartition.results
|
|
|
|
- devices
|
2015-06-26 06:26:03 +08:00
|
|
|
changed_when: false
|
2015-08-18 00:14:06 +08:00
|
|
|
failed_when: false
|
|
|
|
when: item.0.rc != 0
|
2014-09-05 03:14:11 +08:00
|
|
|
|
2015-05-16 00:27:41 +08:00
|
|
|
# NOTE (leseb): this task is for partitions because we don't explicitly use a partition.
|
2015-07-24 02:01:43 +08:00
|
|
|
- name: activate osd(s) when device is a partition
|
2014-09-05 03:14:11 +08:00
|
|
|
command: "ceph-disk activate {{ item.1 }}"
|
|
|
|
with_together:
|
|
|
|
- ispartition.results
|
|
|
|
- devices
|
2015-06-26 06:26:03 +08:00
|
|
|
changed_when: false
|
2015-07-29 00:21:15 +08:00
|
|
|
failed_when: false
|
2014-09-05 03:14:11 +08:00
|
|
|
when: item.0.rc == 0
|
|
|
|
|
2015-01-09 01:27:43 +08:00
|
|
|
- include: osd_fragment.yml
|
|
|
|
when: crush_location
|
|
|
|
|
2015-11-21 05:34:29 +08:00
|
|
|
- name: start and add that the osd service(s) to the init sequence (before infernalis)
|
2015-10-19 09:24:47 +08:00
|
|
|
service:
|
|
|
|
name: ceph
|
|
|
|
state: started
|
|
|
|
enabled: yes
|
2015-11-21 05:34:29 +08:00
|
|
|
when:
|
2015-11-20 22:09:34 +08:00
|
|
|
ansible_distribution != "Ubuntu" and
|
|
|
|
not is_ceph_infernalis
|
2015-11-21 05:34:29 +08:00
|
|
|
|
2016-01-13 04:41:51 +08:00
|
|
|
- name: get osd id (for or after infernalis)
|
|
|
|
shell: "ls /var/lib/ceph/osd/ |grep -oh '[0-9]*'"
|
|
|
|
changed_when: false
|
|
|
|
failed_when: false
|
|
|
|
register: osd_id
|
|
|
|
when:
|
|
|
|
ansible_distribution != "Ubuntu" and
|
|
|
|
is_ceph_infernalis
|
|
|
|
|
|
|
|
- name: enable osd service instance(s) (for or after infernalis)
|
2016-01-13 22:13:30 +08:00
|
|
|
file:
|
|
|
|
src: /usr/lib/systemd/system/ceph-osd@.service
|
|
|
|
dest: /etc/systemd/system/multi-user.target.wants/ceph-osd@{{ item }}.service
|
|
|
|
state: link
|
2016-01-13 04:41:51 +08:00
|
|
|
with_items: osd_id.stdout_lines
|
|
|
|
failed_when: false
|
|
|
|
when:
|
|
|
|
ansible_distribution != "Ubuntu" and
|
|
|
|
is_ceph_infernalis
|
|
|
|
|
2015-11-20 22:09:34 +08:00
|
|
|
- name: start and add that the osd service(s) to the init sequence (for or after infernalis)
|
2015-11-21 05:34:29 +08:00
|
|
|
service:
|
2016-01-13 04:41:51 +08:00
|
|
|
name: ceph-osd@{{ item }}
|
2015-11-21 05:34:29 +08:00
|
|
|
state: started
|
|
|
|
enabled: yes
|
2016-01-13 04:41:51 +08:00
|
|
|
with_items: osd_id.stdout_lines
|
|
|
|
changed_when: false
|
2015-11-21 05:34:29 +08:00
|
|
|
when:
|
2015-11-20 22:09:34 +08:00
|
|
|
ansible_distribution != "Ubuntu" and
|
|
|
|
is_ceph_infernalis
|