validate: make sure ceph_stable_release is set to the correct value

Signed-off-by: Andrew Schoen <aschoen@redhat.com>
pull/2619/head
Andrew Schoen 2018-04-26 15:47:33 -05:00 committed by Guillaume Abrioux
parent ba7f09c0a7
commit 377fe81c10
2 changed files with 7 additions and 24 deletions

View File

@ -22,6 +22,8 @@ class ActionModule(ActionBase):
host = host_vars['ansible_hostname'] host = host_vars['ansible_hostname']
mode = self._task.args.get('mode', 'permissive') mode = self._task.args.get('mode', 'permissive')
print host_vars['groups']
self._supports_check_mode = False # XXX ? self._supports_check_mode = False # XXX ?
self._supports_async = True 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'" 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 = ( install_options = (
("ceph_origin", ceph_origin_choices), ("ceph_origin", ceph_origin_choices),
('osd_objectstore', osd_objectstore_choices), ('osd_objectstore', osd_objectstore_choices),
@ -132,7 +138,7 @@ ceph_origin_repository = ("ceph_repository", ceph_repository_choices)
ceph_repository_community = ( ceph_repository_community = (
("ceph_mirror", types.string), ("ceph_mirror", types.string),
("ceph_stable_key", types.string), ("ceph_stable_key", types.string),
("ceph_stable_release", types.string), ("ceph_stable_release", validate_ceph_stable_release),
("ceph_stable_repo", types.string), ("ceph_stable_repo", types.string),
) )

View File

@ -11,29 +11,6 @@
- ansible_os_family == 'Debian' - ansible_os_family == 'Debian'
- ceph_origin == 'local' - 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 - name: verify that ceph_rhcs_cdn_debian_repo url is valid for red hat storage
fail: fail:
msg: "ceph_rhcs_cdn_debian_repo url is invalid, please set your customername:customerpasswd" msg: "ceph_rhcs_cdn_debian_repo url is invalid, please set your customername:customerpasswd"