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

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

(cherry picked from commit 41bc7816f3)

Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>
This commit is contained in:
patchback[bot] 2021-02-14 16:05:59 +01:00 committed by GitHub
parent e77c5413c9
commit 370f5d8082
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: registration_token:
description: description:
- The registration token is used to register new runners. - The registration token is used to register new runners.
required: True - Required if I(state) is C(present).
type: str type: str
owned: owned:
description: description:
@ -309,7 +309,7 @@ def main():
locked=dict(type='bool', default=False), locked=dict(type='bool', default=False),
access_level=dict(type='str', default='ref_protected', choices=["not_protected", "ref_protected"]), access_level=dict(type='str', default='ref_protected', choices=["not_protected", "ref_protected"]),
maximum_timeout=dict(type='int', default=3600), 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"]), state=dict(type='str', default="present", choices=["absent", "present"]),
)) ))
@ -325,6 +325,9 @@ def main():
required_one_of=[ required_one_of=[
['api_username', 'api_token'], ['api_username', 'api_token'],
], ],
required_if=[
('state', 'present', ['registration_token']),
],
supports_check_mode=True, supports_check_mode=True,
) )