From da4cce2c749acc8458f32b0e5d26b2ab8ec9bdd0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Han?= Date: Wed, 26 Jul 2017 11:54:19 +0200 Subject: [PATCH] common: make ceph_stable_release mandatory MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit It is mandatory now to set the Ceph version you want to install, e.g: ceph_stable_release: luminous To find the release names, you can look at the release not doc: http://docs.ceph.com/docs/master/release-notes/ Signed-off-by: Sébastien Han --- group_vars/all.yml.sample | 2 +- roles/ceph-common/defaults/main.yml | 2 +- .../tasks/checks/check_mandatory_vars.yml | 18 ++++++++++++++++++ roles/ceph-common/tasks/release.yml | 8 -------- 4 files changed, 20 insertions(+), 10 deletions(-) diff --git a/group_vars/all.yml.sample b/group_vars/all.yml.sample index 7bd6a6405..00ffb6ab3 100644 --- a/group_vars/all.yml.sample +++ b/group_vars/all.yml.sample @@ -105,7 +105,7 @@ dummy: #ceph_stable: false # use ceph stable branch #ceph_mirror: http://download.ceph.com #ceph_stable_key: https://download.ceph.com/keys/release.asc -#ceph_stable_release: kraken # ceph stable release +#ceph_stable_release: dummy #ceph_stable_repo: "{{ ceph_mirror }}/debian-{{ ceph_stable_release }}" ###################################### diff --git a/roles/ceph-common/defaults/main.yml b/roles/ceph-common/defaults/main.yml index 4cf298840..93dac1584 100644 --- a/roles/ceph-common/defaults/main.yml +++ b/roles/ceph-common/defaults/main.yml @@ -97,7 +97,7 @@ ceph_use_distro_backports: false # DEBIAN ONLY ceph_stable: false # use ceph stable branch ceph_mirror: http://download.ceph.com ceph_stable_key: https://download.ceph.com/keys/release.asc -ceph_stable_release: kraken # ceph stable release +ceph_stable_release: dummy ceph_stable_repo: "{{ ceph_mirror }}/debian-{{ ceph_stable_release }}" ###################################### diff --git a/roles/ceph-common/tasks/checks/check_mandatory_vars.yml b/roles/ceph-common/tasks/checks/check_mandatory_vars.yml index c202d4404..b4ef088f9 100644 --- a/roles/ceph-common/tasks/checks/check_mandatory_vars.yml +++ b/roles/ceph-common/tasks/checks/check_mandatory_vars.yml @@ -22,6 +22,24 @@ tags: - package-install +- name: make sure ceph_stable_release is set + fail: + msg: "make sure ceph_stable_release is set to a release name (e.g: luminous), http://docs.ceph.com/docs/master/release-notes/" + when: + - ceph_stable_release == 'dummy' + - not ceph_rhcs + tags: + - package-install + +- name: make sure ceph_stable_release is correct + fail: + msg: "wrong release name, see http://docs.ceph.com/docs/master/release-notes/" + when: + - ceph_stable_release not in ceph_release_num + - not ceph_rhcs + tags: + - package-install + - name: verify that a method was chosen for red hat storage fail: msg: "choose between ceph_rhcs_cdn_install and ceph_rhcs_iso_install" diff --git a/roles/ceph-common/tasks/release.yml b/roles/ceph-common/tasks/release.yml index 3bb54e038..f3e33a32a 100644 --- a/roles/ceph-common/tasks/release.yml +++ b/roles/ceph-common/tasks/release.yml @@ -2,11 +2,3 @@ # Set ceph_release to ceph_stable by default - set_fact: ceph_release: "{{ ceph_stable_release }}" - -# Set ceph_release to latest known release (Which should match ceph_dev) -- set_fact: - ceph_release: "{{ item.key }}" - when: - - ceph_dev - - ({{ item.value }} > ceph_release_num.{{ ceph_release }}) - with_dict: "{{ ceph_release_num }}"