1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00

Add check for rundeck_acl_policy name (#612)

* Add check for rundeck_acl_policy name

* Update changelogs/fragments/add_argument_check_for_rundeck.yaml

Co-authored-by: Andrew Klychkov <aaklychkov@mail.ru>

Co-authored-by: Andrew Klychkov <aaklychkov@mail.ru>
This commit is contained in:
Mr Bleu 2020-07-16 23:17:18 +02:00 committed by GitHub
parent 64c4548b7f
commit 9e76fdc668
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 0 deletions

View file

@ -0,0 +1,2 @@
minor_changes:
- rundeck_acl_policy - add check for rundeck_acl_policy name parameter (https://github.com/ansible-collections/community.general/pull/612).

View file

@ -118,6 +118,7 @@ from ansible.module_utils.basic import AnsibleModule
from ansible.module_utils.urls import fetch_url, url_argument_spec
from ansible.module_utils._text import to_text
import json
import re
class RundeckACLManager:
@ -230,6 +231,9 @@ def main():
supports_check_mode=True
)
if not bool(re.match("[a-zA-Z0-9,.+_-]+", module.params["name"])):
module.fail_json(msg="Name contains forbidden characters. The policy can contain the characters: a-zA-Z0-9,.+_-")
if module.params["api_version"] < 14:
module.fail_json(msg="API version should be at least 14")