ceph-ansible/roles/ceph-common/tasks/RedHat.yml

55 lines
1.8 KiB
YAML

---
## 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
fail: msg="Architecture not supported {{ ansible_architecture }}"
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']
- name: Install dependencies
yum: name={{ item }} state=present
with_items:
- python-pycurl
- ntp
- hdparm
- name: Install the Ceph stable repository key
rpm_key: key={{ ceph_key }} state=present
when: ceph_stable
- name: Install the Ceph developement repository key
rpm_key: key={{ ceph_key }} state=present
when: ceph_dev
- name: Add Ceph stable repository
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
when: ceph_stable
- name: Add Ceph development repository
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
when: ceph_dev
- name: Install Ceph
yum: name=ceph state=latest
- name: Check for a Ceph socket
shell: stat /var/run/ceph/*.asok > /dev/null 2>&1
ignore_errors: true
register: socket
- name: Generate Ceph configuration file
template: src=ceph.conf.j2 dest=/etc/ceph/ceph.conf owner=root group=root mode=0644
notify: restart ceph debian redhat
- name: Disable OSD directory parsing by updatedb
command: updatedb -e /var/lib/ceph
ignore_errors: true