Implemented fix pointed in issue (#1760) (#1817)

(cherry picked from commit 41bc7816f3)

Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>
pull/1820/head
patchback[bot] 2021-02-14 16:06:03 +01:00 committed by GitHub
parent 21204e1d46
commit 0f91fea501
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 2 deletions

View File

@ -0,0 +1,2 @@
bugfixes:
- gitlab_runner - parameter ``registration_token`` was required but is used only when ``state`` is ``present`` (https://github.com/ansible-collections/community.general/issues/1714).

View File

@ -55,7 +55,7 @@ options:
registration_token:
description:
- The registration token is used to register new runners.
required: True
- Required if I(state) is C(present).
type: str
active:
description:
@ -284,7 +284,7 @@ def main():
locked=dict(type='bool', default=False),
access_level=dict(type='str', default='ref_protected', choices=["not_protected", "ref_protected"]),
maximum_timeout=dict(type='int', default=3600),
registration_token=dict(type='str', required=True, no_log=True),
registration_token=dict(type='str', no_log=True),
state=dict(type='str', default="present", choices=["absent", "present"]),
))
@ -300,6 +300,9 @@ def main():
required_one_of=[
['api_username', 'api_token'],
],
required_if=[
('state', 'present', ['registration_token']),
],
supports_check_mode=True,
)