From 5f8fe38421a9d9505cf89cd08eca3eac2c5519bc Mon Sep 17 00:00:00 2001 From: Christoph Fiehe Date: Sat, 28 Jan 2023 12:52:16 +0100 Subject: [PATCH] Fixes #5907: gitlab_runner is not idempotent on first run after runner creation This fix adds the missing parameter 'access_level' on runner creation. Signed-off-by: Christoph Fiehe --- .../fragments/5907-fix-gitlab_runner-not-idempotent.yml | 2 ++ plugins/modules/gitlab_runner.py | 5 +++-- 2 files changed, 5 insertions(+), 2 deletions(-) create mode 100644 changelogs/fragments/5907-fix-gitlab_runner-not-idempotent.yml diff --git a/changelogs/fragments/5907-fix-gitlab_runner-not-idempotent.yml b/changelogs/fragments/5907-fix-gitlab_runner-not-idempotent.yml new file mode 100644 index 00000000000..8adf3deace2 --- /dev/null +++ b/changelogs/fragments/5907-fix-gitlab_runner-not-idempotent.yml @@ -0,0 +1,2 @@ +bugfixes: + - gitlab_runner - add missing parameter 'access_level' on runner creation (https://github.com/ansible-collections/community.general/issues/5907). diff --git a/plugins/modules/gitlab_runner.py b/plugins/modules/gitlab_runner.py index 1094df9424c..9f7e3f4e530 100644 --- a/plugins/modules/gitlab_runner.py +++ b/plugins/modules/gitlab_runner.py @@ -87,7 +87,7 @@ - If set to C(ref_protected), runner can pick up jobs only from protected branches. - If set to C(not_protected), runner can pick up jobs from both protected and unprotected branches. required: false - default: ref_protected + default: not_protected choices: ["ref_protected", "not_protected"] type: str maximum_timeout: @@ -216,6 +216,7 @@ def create_or_update_runner(self, description, options): 'locked': options['locked'], 'run_untagged': options['run_untagged'], 'maximum_timeout': options['maximum_timeout'], + 'access_level': options['access_level'], 'tag_list': options['tag_list'], }) changed = True @@ -327,7 +328,7 @@ def main(): tag_list=dict(type='list', elements='str', default=[]), run_untagged=dict(type='bool', default=True), 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='not_protected', choices=["not_protected", "ref_protected"]), maximum_timeout=dict(type='int', default=3600), registration_token=dict(type='str', no_log=True), project=dict(type='str'),