diff --git a/README.md b/README.md index b579800b7..c08a7bc4f 100644 --- a/README.md +++ b/README.md @@ -87,12 +87,14 @@ monitor. If using these playbooks in production, you must generate your own `fsi in `group_vars/all` and `monitor_secret` in `group_vars/mons`. Those files contain information about how to generate appropriate values for these variables. -## Specifying package origin (Debian-based only) +## Specifying package origin -By default, ceph-common installs from Ceph APT repository. However, you +By default, ceph-common installs from Ceph repository. However, you can set `ceph_origin` to "distro" to install Ceph from your default repository. +### For Debian based systems + If you want to use "backports", you can set "true" to `ceph_use_distro_backports`. Attention, ceph-common doesn't manage backports repository, you must add it yourself. diff --git a/group_vars/all.sample b/group_vars/all.sample index b7d4caf85..941254700 100644 --- a/group_vars/all.sample +++ b/group_vars/all.sample @@ -34,10 +34,10 @@ dummy: # - epel-release # - ntp -## Configure package origin (Debian-based only) +## Configure package origin # #ceph_origin: 'upstream' # or 'distro' -#ceph_use_distro_backports: false +#ceph_use_distro_backports: false # DEBIAN ONLY # STABLE ######## diff --git a/roles/ceph-common/defaults/main.yml b/roles/ceph-common/defaults/main.yml index 810cd99a9..769110cfe 100644 --- a/roles/ceph-common/defaults/main.yml +++ b/roles/ceph-common/defaults/main.yml @@ -31,10 +31,10 @@ redhat_package_dependencies: - epel-release - ntp -## Configure package origin (Debian-based only) +## Configure package origin # ceph_origin: 'upstream' # or 'distro' -ceph_use_distro_backports: false +ceph_use_distro_backports: false # DEBIAN ONLY # STABLE diff --git a/roles/ceph-common/tasks/installs/install_on_redhat.yml b/roles/ceph-common/tasks/installs/install_on_redhat.yml index 11d4e2a05..2a6bfa05f 100644 --- a/roles/ceph-common/tasks/installs/install_on_redhat.yml +++ b/roles/ceph-common/tasks/installs/install_on_redhat.yml @@ -5,61 +5,9 @@ state=present with_items: redhat_package_dependencies -- name: install the ceph stable repository key - rpm_key: > - key={{ ceph_stable_key }} - state=present - when: ceph_stable - -- name: install the ceph development repository key - rpm_key: > - key={{ ceph_dev_key }} - state=present - when: ceph_dev - -- name: install inktank ceph enterprise repository key - rpm_key: > - key={{ ceph_stable_ice_temp_path }}/release.asc - state=present - when: ceph_stable_ice - -- name: install red hat storage repository key - rpm_key: > - key={{ ceph_stable_rh_storage_repository_path }}/RPM-GPG-KEY-redhat-release - state=present - when: - ceph_stable_rh_storage and - ceph_stable_rh_storage_iso_install - -- 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 - when: ceph_stable - -- name: add ceph development repository - yum: name=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 - changed_when: false - when: ceph_dev - -- name: add inktank ceph enterprise repository - template: > - src=redhat_ice_repo.j2 - dest=/etc/yum.repos.d/ice.repo - owner=root - group=root - mode=0644 - when: ceph_stable_ice - -- name: add red hat storage repository - template: > - src=redhat_storage_repo.j2 - dest=/etc/yum.repos.d/rh_storage.repo - owner=root - group=root - mode=0644 - when: - ceph_stable_rh_storage and - ceph_stable_rh_storage_iso_install +- name: configure ceph yum repository + include: redhat_ceph_repository.yml + when: ceph_origin == 'upstream' - name: install ceph yum: > diff --git a/roles/ceph-common/tasks/installs/redhat_ceph_repository.yml b/roles/ceph-common/tasks/installs/redhat_ceph_repository.yml new file mode 100644 index 000000000..fda340afd --- /dev/null +++ b/roles/ceph-common/tasks/installs/redhat_ceph_repository.yml @@ -0,0 +1,58 @@ +--- +- name: install the ceph stable repository key + rpm_key: > + key={{ ceph_stable_key }} + state=present + when: ceph_stable + +- name: install the ceph development repository key + rpm_key: > + key={{ ceph_dev_key }} + state=present + when: ceph_dev + +- name: install inktank ceph enterprise repository key + rpm_key: > + key={{ ceph_stable_ice_temp_path }}/release.asc + state=present + when: ceph_stable_ice + +- name: install red hat storage repository key + rpm_key: > + key={{ ceph_stable_rh_storage_repository_path }}/RPM-GPG-KEY-redhat-release + state=present + when: + ceph_stable_rh_storage and + ceph_stable_rh_storage_iso_install + +- 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 + when: ceph_stable + +- name: add ceph development repository + yum: name=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 + changed_when: false + when: ceph_dev + +- name: add inktank ceph enterprise repository + template: > + src=redhat_ice_repo.j2 + dest=/etc/yum.repos.d/ice.repo + owner=root + group=root + mode=0644 + when: ceph_stable_ice + +- name: add red hat storage repository + template: > + src=redhat_storage_repo.j2 + dest=/etc/yum.repos.d/rh_storage.repo + owner=root + group=root + mode=0644 + when: + ceph_stable_rh_storage and + ceph_stable_rh_storage_iso_install + +