diff --git a/group_vars/all b/group_vars/all index acf2a8854..8eb39e170 100644 --- a/group_vars/all +++ b/group_vars/all @@ -27,7 +27,7 @@ dummy: # # for supported distros, see http://ceph.com/rpm-{{ ceph_stable_release }}/ #ceph_stable_redhat_distro: el7 -# ENTERPRISE VERSION +# ENTERPRISE VERSION ICE (old, prior to the 1.3) #ceph_stable_ice: false # use Inktank Ceph Enterprise #ceph_stable_ice_url: https://download.inktank.com/enterprise #ceph_stable_ice_temp_path: /opt/ICE/ceph-repo/ @@ -38,6 +38,24 @@ dummy: #ceph_stable_ice_user: # htaccess user #ceph_stable_ice_password: # htaccess password +# ENTERPRISE VERSION RED HAT STORAGE (from 1.3) +# This version is only supported on RHEL 7.1 +# As of RHEL 7.1, libceph.ko and rbd.ko are now included in Red Hat's kernel +# packages natively. The RHEL 7.1 kernel packages are more stable and secure than +# using these 3rd-party kmods with RHEL 7.0. Please update your systems to RHEL +# 7.1 or later if you want to use the kernel RBD client. +# +# The CephFS kernel client is undergoing rapid development upstream, and we do +# not recommend running the CephFS kernel module on RHEL 7's 3.10 kernel at this +# time. Please use ELRepo's latest upstream 4.x kernels if you want to run CephFS +# on RHEL 7. +# +#ceph_stable_rh_storage: false +#ceph_stable_rh_storage_url: (can be found at https://access.redhat.com/products/red-hat-ceph-storage/get-started) +#ceph_stable_rh_storage_iso_checksum: +#ceph_stable_rh_storage_mount_path: /tmp/rh-storage-repo +#ceph_stable_rh_storage_download_path: /tmp/ + # DEV # ### diff --git a/roles/ceph-common/defaults/main.yml b/roles/ceph-common/defaults/main.yml index 48d2e9b95..251570efe 100644 --- a/roles/ceph-common/defaults/main.yml +++ b/roles/ceph-common/defaults/main.yml @@ -24,7 +24,7 @@ ceph_stable_release: hammer # ceph stable release # # for supported distros, see http://ceph.com/rpm-{{ ceph_stable_release }}/ ceph_stable_redhat_distro: el7 -# ENTERPRISE VERSION +# ENTERPRISE VERSION ICE (old, prior to the 1.3) ceph_stable_ice: false # use Inktank Ceph Enterprise #ceph_stable_ice_url: https://download.inktank.com/enterprise #ceph_stable_ice_temp_path: /opt/ICE/ceph-repo/ @@ -35,6 +35,25 @@ ceph_stable_ice: false # use Inktank Ceph Enterprise #ceph_stable_ice_user: # htaccess user #ceph_stable_ice_password: # htaccess password +# ENTERPRISE VERSION RED HAT STORAGE (from 1.3) +# This version is only supported on RHEL 7.1 +# As of RHEL 7.1, libceph.ko and rbd.ko are now included in Red Hat's kernel +# packages natively. The RHEL 7.1 kernel packages are more stable and secure than +# using these 3rd-party kmods with RHEL 7.0. Please update your systems to RHEL +# 7.1 or later if you want to use the kernel RBD client. +# +# The CephFS kernel client is undergoing rapid development upstream, and we do +# not recommend running the CephFS kernel module on RHEL 7's 3.10 kernel at this +# time. Please use ELRepo's latest upstream 4.x kernels if you want to run CephFS +# on RHEL 7. +# +ceph_stable_rh_storage: false +#ceph_stable_rh_storage_url: (can be found at https://access.redhat.com/products/red-hat-ceph-storage/get-started) +#ceph_stable_rh_storage_iso_checksum: +#ceph_stable_rh_storage_mount_path: /tmp/rh-storage-repo +#ceph_stable_rh_storage_download_path: /tmp/ + + # DEV # ### diff --git a/roles/ceph-common/tasks/install_on_redhat.yml b/roles/ceph-common/tasks/install_on_redhat.yml index 0774e1475..be163d73f 100644 --- a/roles/ceph-common/tasks/install_on_redhat.yml +++ b/roles/ceph-common/tasks/install_on_redhat.yml @@ -28,6 +28,12 @@ state=present when: ceph_stable_ice +- name: install red hat storage repository key + rpm_key: > + key={{ ceph_stable_rh_storage_mount_path }}/RPM-GPG-KEY-redhat-release + state=present + when: ceph_stable_rh_storage + - name: add Ceph stable repository yum: name=http://ceph.com/rpm-{{ ceph_stable_release }}/{{ ceph_stable_redhat_distro }}/noarch/ceph-release-1-0.{{ ceph_stable_redhat_distro|replace('rhel', 'el') }}.noarch.rpm changed_when: false @@ -51,6 +57,29 @@ yum: > name=ceph state=latest + when: not ceph_stable_rh_storage + +- name: install red hat storage ceph mon + yum: > + name={{ item }} + state=latest + with_items: + - ceph + - ceph-mon + when: + ceph_stable_rh_storage and + mon_group_name in group_names + +- name: install red hat storage ceph osd + yum: > + name={{ item }} + state=latest + with_items: + - ceph + - ceph-osd + when: + ceph_stable_rh_storage and + osd_group_name in group_names - name: install Inktank Ceph Enterprise RBD Kernel modules yum: > diff --git a/roles/ceph-common/tasks/main.yml b/roles/ceph-common/tasks/main.yml index 397b93956..def477474 100644 --- a/roles/ceph-common/tasks/main.yml +++ b/roles/ceph-common/tasks/main.yml @@ -7,6 +7,9 @@ - include: prerequisite_ice.yml when: ceph_stable_ice +- include: prerequisite_rh_storage.yml + when: ceph_stable_rh_storage + - include: install_on_redhat.yml when: ansible_os_family == 'RedHat' diff --git a/roles/ceph-common/tasks/os_check.yml b/roles/ceph-common/tasks/os_check.yml index a70f12a4d..c3b92b400 100644 --- a/roles/ceph-common/tasks/os_check.yml +++ b/roles/ceph-common/tasks/os_check.yml @@ -10,3 +10,9 @@ - name: fail on unsupported distribution fail: "msg=Distribution not supported {{ ansible_os_family }}" when: "ansible_os_family not in ['Debian', 'RedHat']" + +- name: fail on unsupported distribution for red hat storage + fail: "msg=Distribution not supported {{ ansible_distribution_version }} by Red Hat Storage, only RHEL 7.1" + when: + ceph_stable_rh_storage and + {{ ansible_distribution_version | version_compare('7.1', '<') }} diff --git a/roles/ceph-common/tasks/prerequisite_rh_storage.yml b/roles/ceph-common/tasks/prerequisite_rh_storage.yml new file mode 100644 index 000000000..496b1f40a --- /dev/null +++ b/roles/ceph-common/tasks/prerequisite_rh_storage.yml @@ -0,0 +1,21 @@ +--- +- name: create red hat storage package directory + file: > + path={{ ceph_stable_rh_storage_mount_path }} + state=directory + owner=root + group=root + mode=0644 + +- name: get red hat storage packages + get_url: > + url={{ ceph_stable_rh_storage_url }} + dest={{ ceph_stable_rh_storage_download_path }}/rh-storage.iso + sha256sum={{ ceph_stable_rh_storage_iso_checksum }} + +- name: mount red hat storage iso file + mount: > + name={{ ceph_stable_rh_storage_mount_path }} + src={{ ceph_stable_rh_storage_download_path }}/rh-storage.iso + fstype=iso9660 + state=mounted diff --git a/roles/ceph-common/templates/redhat_storage_repo.j2 b/roles/ceph-common/templates/redhat_storage_repo.j2 new file mode 100644 index 000000000..4af8d34ce --- /dev/null +++ b/roles/ceph-common/templates/redhat_storage_repo.j2 @@ -0,0 +1,36 @@ +# {{ ansible_managed }} +[rh_storage_mon] +name=Red Hat Storage Ceph - local packages for Ceph +baseurl=file://{{ ceph_stable_rh_storage_mount_path }}/MON +enabled=1 +gpgcheck=1 +type=rpm-md +priority=1 +gpgkey=file://{{ ceph_stable_rh_storage_mount_path }}/RPM-GPG-KEY-redhat-release + +[rh_storage_osd] +name=Red Hat Storage Ceph - local packages for Ceph +baseurl=file://{{ ceph_stable_rh_storage_mount_path }}/OSD +enabled=1 +gpgcheck=1 +type=rpm-md +priority=1 +gpgkey=file://{{ ceph_stable_rh_storage_mount_path }}/RPM-GPG-KEY-redhat-release + +[rh_storage_calamari] +name=Red Hat Storage Ceph - local packages for Ceph +baseurl=file://{{ ceph_stable_rh_storage_mount_path }}/Calamari +enabled=1 +gpgcheck=1 +type=rpm-md +priority=1 +gpgkey=file://{{ ceph_stable_rh_storage_mount_path }}/RPM-GPG-KEY-redhat-release + +[rh_storage_installer] +name=Red Hat Storage Ceph - local packages for Ceph +baseurl=file://{{ ceph_stable_rh_storage_mount_path }}/Installer +enabled=1 +gpgcheck=1 +type=rpm-md +priority=1 +gpgkey=file://{{ ceph_stable_rh_storage_mount_path }}/RPM-GPG-KEY-redhat-release