diff --git a/plugins/actions/validate.py b/plugins/actions/validate.py index 870add6b2..bbba52c75 100644 --- a/plugins/actions/validate.py +++ b/plugins/actions/validate.py @@ -22,6 +22,8 @@ class ActionModule(ActionBase): host = host_vars['ansible_hostname'] mode = self._task.args.get('mode', 'permissive') + print host_vars['groups'] + self._supports_check_mode = False # XXX ? self._supports_async = True @@ -122,6 +124,10 @@ def validate_lvm_volumes(value): assert isinstance(value, basestring), "lvm_volumes must contain a 'journal' key when the objectstore is 'filestore'" +def validate_ceph_stable_release(value): + assert value in ['jewel', 'kraken', 'luminous', 'mimic'], "ceph_stable_release must be set to 'jewel', 'kraken', 'lumious' or 'mimic'" + + install_options = ( ("ceph_origin", ceph_origin_choices), ('osd_objectstore', osd_objectstore_choices), @@ -132,7 +138,7 @@ ceph_origin_repository = ("ceph_repository", ceph_repository_choices) ceph_repository_community = ( ("ceph_mirror", types.string), ("ceph_stable_key", types.string), - ("ceph_stable_release", types.string), + ("ceph_stable_release", validate_ceph_stable_release), ("ceph_stable_repo", types.string), ) diff --git a/roles/ceph-validate/tasks/main.yml b/roles/ceph-validate/tasks/main.yml index 7f81041b1..c13d99493 100644 --- a/roles/ceph-validate/tasks/main.yml +++ b/roles/ceph-validate/tasks/main.yml @@ -11,29 +11,6 @@ - ansible_os_family == 'Debian' - ceph_origin == 'local' -- name: make sure ceph_stable_release is set - fail: - msg: "make sure ceph_stable_release ( {{ ceph_stable_release }} ) is set to a release name (e.g: luminous), http://docs.ceph.com/docs/master/release-notes/" - when: - - ceph_origin != 'distro' - - ceph_stable_release == 'dummy' - - ceph_repository not in ['rhcs', 'dev', 'obs'] - -- name: make sure ceph_stable_release is correct - fail: - msg: "wrong release name, see http://docs.ceph.com/docs/master/release-notes/" - when: - - ceph_stable_release not in ceph_release_num - - ceph_origin == 'repository' - - ceph_repository not in ['rhcs', 'dev', 'obs'] - -- name: make sure ceph_stable_release is correct - fail: - msg: "wrong release name, see http://docs.ceph.com/docs/master/release-notes/" - when: - - ceph_stable_release not in ceph_release_num - - ceph_origin == 'repository' - - name: verify that ceph_rhcs_cdn_debian_repo url is valid for red hat storage fail: msg: "ceph_rhcs_cdn_debian_repo url is invalid, please set your customername:customerpasswd"