2014-03-10 00:08:47 +08:00
|
|
|
---
|
|
|
|
## Common to all the Ceph RedHat nodes
|
|
|
|
#
|
|
|
|
|
|
|
|
- name: Fail on unsupported system
|
|
|
|
fail: msg="System not supported {{ ansible_system }}"
|
|
|
|
when: ansible_system not in ['Linux']
|
|
|
|
|
|
|
|
- name: Fail on unsupported architecture
|
2014-06-03 03:00:43 +08:00
|
|
|
fail: msg="Architecture not supported {{ ansible_architecture }}"
|
2014-03-10 00:08:47 +08:00
|
|
|
when: ansible_architecture not in ['x86_64']
|
|
|
|
|
|
|
|
- name: Fail on unsupported distribution
|
|
|
|
fail: msg="Distribution not supported {{ ansible_os_family }}"
|
|
|
|
when: ansible_os_family not in ['Debian', 'RedHat']
|
|
|
|
|
2014-08-20 16:57:14 +08:00
|
|
|
- name: Install dependencies
|
2014-03-11 22:24:51 +08:00
|
|
|
yum: name={{ item }} state=present
|
2014-03-10 00:08:47 +08:00
|
|
|
with_items:
|
|
|
|
- python-pycurl
|
|
|
|
- ntp
|
2014-08-14 20:08:52 +08:00
|
|
|
- hdparm
|
2014-03-10 00:08:47 +08:00
|
|
|
|
2014-09-02 08:37:18 +08:00
|
|
|
- name: Install the Ceph stable repository key
|
2014-09-04 18:18:17 +08:00
|
|
|
rpm_key: key={{ ceph_key }} state=present
|
2014-09-02 08:37:18 +08:00
|
|
|
when: ceph_stable
|
2014-03-10 00:08:47 +08:00
|
|
|
|
2014-09-02 08:37:18 +08:00
|
|
|
- name: Install the Ceph developement repository key
|
2014-09-04 18:18:17 +08:00
|
|
|
rpm_key: key={{ ceph_key }} state=present
|
2014-09-02 08:37:18 +08:00
|
|
|
when: ceph_dev
|
|
|
|
|
|
|
|
- name: Add Ceph stable repository
|
2014-09-04 18:18:17 +08:00
|
|
|
command: rpm -U http://ceph.com/rpm-{{ ceph_stable_release }}/{{ redhat_distro }}/noarch/ceph-release-1-0.el6.noarch.rpm creates=/etc/yum.repos.d/ceph.repo
|
2014-09-02 08:37:18 +08:00
|
|
|
when: ceph_stable
|
|
|
|
|
|
|
|
- name: Add Ceph development repository
|
2014-09-04 18:18:17 +08:00
|
|
|
command: rpm -U http://gitbuilder.ceph.com/ceph-rpm-{{ ceph_dev_redhat_distro }}-x86_64-basic/ref/{{ ceph_dev_branch }}/noarch/ceph-release-1-0.{{ ceph_stable_redhat_distro }}.noarch.rpm creates=/etc/yum.repos.d/ceph.repo
|
2014-09-02 08:37:18 +08:00
|
|
|
when: ceph_dev
|
2014-03-10 00:08:47 +08:00
|
|
|
|
|
|
|
- name: Install Ceph
|
|
|
|
yum: name=ceph state=latest
|
|
|
|
|
2014-08-20 20:04:34 +08:00
|
|
|
- name: Check for a Ceph socket
|
|
|
|
shell: stat /var/run/ceph/*.asok > /dev/null 2>&1
|
|
|
|
ignore_errors: true
|
|
|
|
register: socket
|
|
|
|
|
2014-03-10 00:08:47 +08:00
|
|
|
- name: Generate Ceph configuration file
|
2014-07-14 21:11:27 +08:00
|
|
|
template: src=ceph.conf.j2 dest=/etc/ceph/ceph.conf owner=root group=root mode=0644
|
2014-08-30 08:34:11 +08:00
|
|
|
notify: restart ceph debian redhat
|
2014-08-21 20:21:05 +08:00
|
|
|
|
|
|
|
- name: Disable OSD directory parsing by updatedb
|
|
|
|
command: updatedb -e /var/lib/ceph
|
2014-09-04 18:18:17 +08:00
|
|
|
ignore_errors: true
|