From f6b6f7d5b020af502f85d4b377e20e432b3ae2f7 Mon Sep 17 00:00:00 2001 From: Johannes Kastl Date: Wed, 21 Aug 2019 21:54:03 +0200 Subject: [PATCH] plugins/actions/validate.py: allow ceph_repository 'obs' on openSUSE 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 --- plugins/actions/validate.py | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/plugins/actions/validate.py b/plugins/actions/validate.py index fa755b171..df42d558d 100644 --- a/plugins/actions/validate.py +++ b/plugins/actions/validate.py @@ -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 = ( -- 2.39.5