]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph-ansible.git/commitdiff
plugins/actions/validate.py: allow ceph_repository 'obs' on openSUSE
authorJohannes Kastl <kastl@b1-systems.de>
Wed, 21 Aug 2019 19:54:03 +0000 (21:54 +0200)
committerGuillaume Abrioux <gabrioux@redhat.com>
Thu, 22 Aug 2019 18:23:15 +0000 (20:23 +0200)
Allow the use of 'obs' as a valid value for ceph_repository, and validate that
- OS is openSUSE
- ceph_obs_repo is defined

Signed-off-by: Johannes Kastl <kastl@b1-systems.de>
plugins/actions/validate.py

index fa755b1716fc7edc8506378fa1068ec98adfedf9..df42d558d153b01e9d8122766860d3cf474a8141 100644 (file)
@@ -47,6 +47,7 @@ class ActionModule(ActionBase):
 
         try:
             notario_store["groups"] = host_vars["groups"]
+            notario_store["ansible_distribution"] = host_vars["ansible_distribution"]
             notario_store["containerized_deployment"] = host_vars["containerized_deployment"]  # noqa E501
             notario.validate(host_vars, install_options, defined_keys=True)
 
@@ -66,6 +67,10 @@ class ActionModule(ActionBase):
                     notario.validate(
                         host_vars, ceph_repository_dev, defined_keys=True)
 
+                if host_vars["ceph_repository"] == "obs":
+                    notario.validate(
+                        host_vars, ceph_repository_obs, defined_keys=True)
+
                 if host_vars["ceph_repository"] == "custom":
                     notario.validate(host_vars, ceph_repository_custom, defined_keys=True)
 
@@ -172,8 +177,8 @@ def ceph_origin_choices(value):
 
 
 def ceph_repository_choices(value):
-    msg = "ceph_repository must be either 'community', 'rhcs', 'dev', 'custom' or 'uca'"
-    assert value in ['community', 'rhcs', 'dev', 'custom', 'uca'], msg
+    msg = "ceph_repository must be either 'community', 'rhcs', 'dev', 'custom', 'uca' or 'obs'"
+    assert value in ['community', 'rhcs', 'dev', 'custom', 'uca', 'obs'], msg
 
 
 def ceph_repository_type_choices(value):
@@ -256,6 +261,11 @@ ceph_repository_dev = (
     ("ceph_dev_sha1", types.string),
 )
 
+ceph_repository_obs = (
+    ("ansible_distribution", "openSUSE Leap"),
+    ("ceph_obs_repo", types.string),
+)
+
 ceph_repository_custom = ("ceph_custom_repo", types.string)
 
 ceph_repository_uca = (