]> git.apps.os.sepia.ceph.com Git - ceph-ansible.git/commitdiff
Add uca to ceph_repository choices validation v3.2.10
authorDimitri Savineau <dsavinea@redhat.com>
Fri, 22 Mar 2019 19:03:15 +0000 (15:03 -0400)
committermergify[bot] <mergify[bot]@users.noreply.github.com>
Tue, 26 Mar 2019 10:27:08 +0000 (10:27 +0000)
Ubuntu cloud archive is configurable via ceph_repository variable but
the uca choice isn't accepted.
This commit fixes this issue and also validates the associated uca
repository variables.

Resolves: #3739

Signed-off-by: Dimitri Savineau <dsavinea@redhat.com>
(cherry picked from commit 94505a3af264fc0e847e71cbf633dc02ce58e6ff)

plugins/actions/validate.py

index 2e91685a94a69a3449362c248fecf43bf2281d82..79fc9418c64e3bae2290701d6b1f42165fa1a19e 100644 (file)
@@ -60,6 +60,9 @@ class ActionModule(ActionBase):
                 if host_vars["ceph_repository"] == "dev":
                     notario.validate(host_vars, ceph_repository_dev, defined_keys=True)
 
+                if host_vars["ceph_repository"] == "uca":
+                    notario.validate(host_vars, ceph_repository_uca, defined_keys=True)
+
             # store these values because one must be defined and the validation method
             # will need access to all three through the store
             notario_store["monitor_address"] = host_vars.get("monitor_address", None)
@@ -134,7 +137,8 @@ def ceph_origin_choices(value):
 
 
 def ceph_repository_choices(value):
-    assert value in ['community', 'rhcs', 'dev', 'custom'], "ceph_repository must be either 'community', 'rhcs', 'dev', or 'custom'"
+    msg = "ceph_repository must be either 'community', 'rhcs', 'dev', 'custom' or 'uca'"
+    assert value in ['community', 'rhcs', 'dev', 'custom', 'uca'], msg
 
 
 def ceph_repository_type_choices(value):
@@ -214,6 +218,12 @@ ceph_repository_dev = (
     ("ceph_dev_sha1", types.string),
 )
 
+ceph_repository_uca = (
+    ("ceph_stable_repo_uca", types.string),
+    ("ceph_stable_openstack_release_uca", types.string),
+    ("ceph_stable_release_uca", types.string),
+)
+
 monitor_options = (
     ("cluster_network", types.string),
     ("fsid", types.string),