From: Guillaume Abrioux Date: Sat, 24 Sep 2022 05:15:36 +0000 (+0200) Subject: library: fix a bug in ceph_key module X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=855f74248674e57915843b00d2250ae77f0aa6fc;p=ceph-ansible.git library: fix a bug in ceph_key module `name` is a mandatory parameter when `state` is either `present` or `absent` or `update` or `info`. Signed-off-by: Guillaume Abrioux --- diff --git a/library/ceph_key.py b/library/ceph_key.py index a0ca3b2a0..a444b2d88 100644 --- a/library/ceph_key.py +++ b/library/ceph_key.py @@ -519,6 +519,10 @@ def run_module(): user_key = module.params.get('user_key') output_format = module.params.get('output_format') + # Can't use required_if with 'name' for some reason... + if state in ['present', 'absent', 'update', 'info'] and not name: + fatal(f'"state" is "{state}" but "name" is not defined.', module) + changed = False result = dict(