]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph-ansible.git/commitdiff
ceph-validate: Refactor check for installation check on SUSE/openSUSE
authorJohannes Kastl <kastl@b1-systems.de>
Wed, 21 Aug 2019 18:56:36 +0000 (20:56 +0200)
committerGuillaume Abrioux <gabrioux@redhat.com>
Thu, 22 Aug 2019 18:22:13 +0000 (20:22 +0200)
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 <kastl@b1-systems.de>
roles/ceph-common/tasks/installs/install_on_suse.yml
roles/ceph-validate/tasks/main.yml

index 8a682bda19b69d52d20709f6f7d15a0f50aecb58..442400b8faca4abf43a2f1d462298b022df5299f 100644 (file)
@@ -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'
index 916503570e69a915e355c1acf994c3c033ddaf1c..71af87fe3214bd913a607c9a924c28e609081b62 100644 (file)
         - 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"
       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