mirror of
https://github.com/freeipa/ansible-freeipa.git
synced 2026-07-31 20:04:45 +00:00
library/ipajoin.py: Enhanced tests for password and keytab
mutually_exclusive and required_one_of are only able to check if the parameters are defined, but not if they are set to "".
This commit is contained in:
@@ -202,8 +202,6 @@ def main():
|
|||||||
kinit_attempts=dict(required=False, type='int', default=5),
|
kinit_attempts=dict(required=False, type='int', default=5),
|
||||||
debug=dict(required=False, type='bool'),
|
debug=dict(required=False, type='bool'),
|
||||||
),
|
),
|
||||||
mutually_exclusive = [['password','keytab']],
|
|
||||||
required_one_of = [['password', 'keytab']],
|
|
||||||
supports_check_mode = True,
|
supports_check_mode = True,
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -222,6 +220,10 @@ def main():
|
|||||||
kinit_attempts = module.params.get('kinit_attempts')
|
kinit_attempts = module.params.get('kinit_attempts')
|
||||||
debug = module.params.get('debug')
|
debug = module.params.get('debug')
|
||||||
|
|
||||||
|
if password is not None and password != "" and \
|
||||||
|
keytab is not None and keytab != "":
|
||||||
|
module.fail_json(msg="Password and keytab cannot be used together")
|
||||||
|
|
||||||
client_domain = hostname[hostname.find(".")+1:]
|
client_domain = hostname[hostname.find(".")+1:]
|
||||||
nolog = tuple()
|
nolog = tuple()
|
||||||
env = {'PATH': SECURE_PATH}
|
env = {'PATH': SECURE_PATH}
|
||||||
|
|||||||
Reference in New Issue
Block a user