Skip to content

Commit

Permalink
Merge pull request #654 from rjeffman/templates_variables_invtest
Browse files Browse the repository at this point in the history
Fix module templates README and invalid parameter tests.
  • Loading branch information
t-woerner committed Oct 4, 2021
2 parents e54b467 + 2a169ce commit 48d0b2f
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 10 deletions.
2 changes: 2 additions & 0 deletions utils/templates/README-module+member.md.in
Expand Up @@ -119,6 +119,8 @@ Variable | Description | Required
-------- | ----------- | --------
`ipaadmin_principal` | The admin principal is a string and defaults to `admin` | no
`ipaadmin_password` | The admin password is a string and is required if there is no admin ticket available on the node | no
`ipaapi_context` | The context in which the module will execute. Executing in a server context is preferred. If not provided context will be determined by the execution environment. Valid values are `server` and `client`. | no
`ipaapi_ldap_cache` | Use LDAP cache for IPA connection. The bool setting defaults to yes. (bool) | no
`name` \| `ALIAS` | The list of $name name strings. | yes
`PARAMETER1` \| `API_PARAMETER_NAME` | DESCRIPTION | BOOL
`PARAMETER2` \| `API_PARAMETER_NAME` | DESCRIPTION | BOOL
Expand Down
2 changes: 2 additions & 0 deletions utils/templates/README-module.md.in
Expand Up @@ -84,6 +84,8 @@ Variable | Description | Required
-------- | ----------- | --------
`ipaadmin_principal` | The admin principal is a string and defaults to `admin` | no
`ipaadmin_password` | The admin password is a string and is required if there is no admin ticket available on the node | no
`ipaapi_context` | The context in which the module will execute. Executing in a server context is preferred. If not provided context will be determined by the execution environment. Valid values are `server` and `client`. | no
`ipaapi_ldap_cache` | Use LDAP cache for IPA connection. The bool setting defaults to yes. (bool) | no
`name` \| `ALIAS` | The list of $name name strings. | yes
`PARAMETER1` \| `API_PARAMETER_NAME` | DESCRIPTION | BOOL
`PARAMETER2` \| `API_PARAMETER_NAME` | DESCRIPTION | BOOL
Expand Down
6 changes: 1 addition & 5 deletions utils/templates/ipamodule+member.py.in
Expand Up @@ -185,11 +185,7 @@ def main():
if action == "$name":
invalid.append("PARAMETER2")

for x in invalid:
if vars()[x] is not None:
ansible_module.fail_json(
msg="Argument '%s' can not be used with action "
"'%s' and state '%s'" % (x, action, state))
ansible_module.params_fail_used_invalid(invalid, state, action)

# Init

Expand Down
6 changes: 1 addition & 5 deletions utils/templates/ipamodule.py.in
Expand Up @@ -151,11 +151,7 @@ def main():
ansible_module.fail_json(msg="No name given.")
invalid = ["PARAMETER1", "PARAMETER2"]

for x in invalid:
if vars()[x] is not None:
ansible_module.fail_json(
msg="Argument '%s' can not be used with state '%s'" %
(x, state))
ansible_module.params_fail_used_invalid(invalid, state)

# Init

Expand Down

0 comments on commit 48d0b2f

Please sign in to comment.