]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph-ansible.git/commitdiff
Multi distro installation support 13/head
authorSébastien Han <sebastien.han@enovance.com>
Sun, 9 Mar 2014 16:08:47 +0000 (17:08 +0100)
committerSébastien Han <sebastien.han@enovance.com>
Sun, 9 Mar 2014 16:17:58 +0000 (17:17 +0100)
Now the playbook is able to install Ceph on RedHat systems.
This has been tested on CentOS 6.

Signed-off-by: Sébastien Han <sebastien.han@enovance.com>
group_vars/all
roles/common/tasks/Debian.yml [new file with mode: 0644]
roles/common/tasks/RedHat.yml [new file with mode: 0644]
roles/common/tasks/main.yml

index e4746de45dda5102c94549fbef2123689fd0e87f..618e2df1f12f0eb6a77ff6228f92ff61320ace0a 100644 (file)
@@ -5,6 +5,7 @@
 distro_release: "{{ facter_lsbdistcodename }}"
 apt_key: https://ceph.com/git/?p=ceph.git;a=blob_plain;f=keys/release.asc
 ceph_release: emperor
+redhat_distro: el6 # supported distros are el6, rhel6, f18, f19, opensuse12.2, sles11
 
 # Ceph options
 cephx: true
diff --git a/roles/common/tasks/Debian.yml b/roles/common/tasks/Debian.yml
new file mode 100644 (file)
index 0000000..1274c6e
--- /dev/null
@@ -0,0 +1,40 @@
+---
+## 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="Architeture not supported {{ ansible_architectore }}"
+  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 dependancies
+  apt: pkg={{ item }} state=installed update_cache=yes cache_valid_time=3600 # we update the cache just in case...
+  with_items:
+    - python-pycurl
+    - ntp
+
+- name: Install the Ceph key
+  apt_key: url={{ apt_key }} 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 dependancies 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: Generate ceph configuration file
+  template: src=roles/common/templates/ceph.conf.j2 dest=/etc/ceph/ceph.conf owner=root group=root mode=0644
diff --git a/roles/common/tasks/RedHat.yml b/roles/common/tasks/RedHat.yml
new file mode 100644 (file)
index 0000000..96b734d
--- /dev/null
@@ -0,0 +1,33 @@
+---
+## 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="Architeture not supported {{ ansible_architectore }}"
+  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 dependancies
+  yum: name={{ item }} state=installed
+  with_items:
+    - python-pycurl
+    - ntp
+
+- name: Install the Ceph key
+  rpm_key: key={{ apt_key }} state=present
+
+- name: Add Ceph repository
+  command: rpm -U http://ceph.com/rpm-{{ ceph_release }}/{{ redhat_distro }}/noarch/ceph-release-1-0.el6.noarch.rpm creates=/etc/yum.repos.d/ceph.repo
+
+- name: Install Ceph
+  yum: name=ceph state=latest
+
+- name: Generate Ceph configuration file
+  template: src=roles/common/templates/ceph.conf.j2 dest=/etc/ceph/ceph.conf owner=root group=root mode=0644
index 948f1dd94b21bdda255df4f224e7d2481ee5e500..602b57c69d9e0fdb02145d5c3aad6b17f823cfe8 100644 (file)
@@ -1,36 +1,8 @@
 ---
-## Common to all the ceph nodes
+## Check OS family
 #
 
-- 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="Architeture not supported {{ ansible_architectore }}"
-  when: ansible_architecture not in ['x86_64']
-
-- name: Install dependancies
-  apt: pkg={{ item }} state=installed update_cache=yes # we update the cache just in case...
-  with_items:
-    - python-pycurl
-    - ntp
-
-- name: Install the ceph key
-  apt_key: url={{ apt_key }} 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 dependancies 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: Generate ceph configuration file
-  template: src=roles/common/templates/ceph.conf.j2 dest=/etc/ceph/ceph.conf owner=root group=root mode=0644
+- include: RedHat.yml
+  when: ansible_os_family == 'RedHat'
+- include: Debian.yml
+  when: ansible_os_family == 'Debian'