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

51 lines
1.7 KiB
YAML

---
## Common to all the Ceph Debian 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
apt: pkg={{ item }} state=present update_cache=yes cache_valid_time=3600 # we update the cache just in case...
with_items:
- python-pycurl
- ntp
- hdparm
- name: Install the Ceph key
apt_key: data="{{ lookup('file', 'cephrelease.asc') }}" state=present
- name: Add Ceph repository
apt_repository: repo='deb http://ceph.com/debian-{{ ceph_release }}/ {{ ansible_lsb.codename }} main' state=present
- name: Install Ceph
apt: pkg={{ item }} state=latest
with_items:
- ceph
- ceph-common #|
- ceph-fs-common #|--> yes, they are already all dependencies from 'ceph'
- ceph-fuse #|--> however while proceding to rolling upgrades and the 'ceph' package upgrade
- ceph-mds #|--> they don't get update so we need to force them
- libcephfs1 #|
- 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
- name: Disable OSD directory parsing by updatedb
command: updatedb -e /var/lib/ceph