From: Johannes Kastl Date: Wed, 21 Aug 2019 18:56:36 +0000 (+0200) Subject: ceph-validate: Refactor check for installation check on SUSE/openSUSE X-Git-Tag: v5.0.0alpha1~150 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=efd38ecc88f2a4438f7377f3b93e6d8e7edd851d;p=ceph-ansible.git ceph-validate: Refactor check for installation check on SUSE/openSUSE Move the validation from roles/ceph-common/tasks/installs/install_on_suse.yml to roles/ceph-validate/ and fix the syntax. There are two valid combinations of `ceph_origin` and `ceph_repository` on SUSE/openSUSE: - ceph_origin == 'distro' - ceph_origin == 'repository' and ceph_repository == 'obs' The current when condition would fail even in the valid second combination, as ceph_origin != distro would be true then Fixes: #4362 Signed-off-by: Johannes Kastl --- diff --git a/roles/ceph-common/tasks/installs/install_on_suse.yml b/roles/ceph-common/tasks/installs/install_on_suse.yml index 8a682bda1..442400b8f 100644 --- a/roles/ceph-common/tasks/installs/install_on_suse.yml +++ b/roles/ceph-common/tasks/installs/install_on_suse.yml @@ -1,12 +1,4 @@ --- -# SUSE/openSUSE only supports the following: -# - ceph_origin == 'distro' -# - ceph_origin == 'repository' and ceph_repository == 'obs' -- name: Check for supported installation method on SUSE/openSUSE - fail: - msg: "Unsupported installation method origin:{{ ceph_origin }} repo:{{ ceph_repository }}'" - when: ceph_origin != 'distro' or (ceph_origin == 'repository' and ceph_repository != 'obs') - - name: include configure_suse_repository_installation.yml include_tasks: configure_suse_repository_installation.yml when: ceph_origin == 'repository' diff --git a/roles/ceph-validate/tasks/main.yml b/roles/ceph-validate/tasks/main.yml index 916503570..71af87fe3 100644 --- a/roles/ceph-validate/tasks/main.yml +++ b/roles/ceph-validate/tasks/main.yml @@ -27,6 +27,25 @@ - ceph_rhcs_cdn_debian_repo == 'https://customername:customerpasswd@rhcs.download.redhat.com' - ceph_repository not in ['rhcs', 'dev', 'obs'] +# SUSE/openSUSE Leap only supports the following: +# - ceph_origin == 'distro' +# - ceph_origin == 'repository' and ceph_repository == 'obs' +- name: SUSE/openSUSE Leap based system tasks + when: ansible_os_family == 'Suse' + block: + - name: Check ceph_origin definition on SUSE/openSUSE Leap + fail: + msg: "Unsupported installation method origin:{{ ceph_origin }}" + when: ceph_origin not in ['distro', 'repository'] + + - name: Check ceph_repository definition on SUSE/openSUSE Leap + fail: + msg: "Unsupported installation method origin:{{ ceph_origin }} repo:{{ ceph_repository }}' + only valid combination is ceph_origin == 'repository' and ceph_repository == 'obs'" + when: + - ceph_origin == 'repository' + - ceph_repository != 'obs' + - name: validate ntp daemon type fail: msg: "ntp_daemon_type must be one of chronyd, ntpd, or timesyncd" @@ -116,4 +135,4 @@ fail: msg: "you must add at least one node in the [grafana-server] hosts group" when: groups[grafana_server_group_name] | length < 1 - when: dashboard_enabled | bool \ No newline at end of file + when: dashboard_enabled | bool