Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gitlab: use gitlab instance runner to create runner #3965

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
bugfixes:
- 'gitlab_runner - use correct API endpoint to create and retrieve project level runners when using ``project`` (https://github.com/ansible-collections/community.general/pull/3965).'
6 changes: 3 additions & 3 deletions plugins/modules/source_control/gitlab/gitlab_runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,7 @@ def create_runner(self, arguments):
return True

try:
runner = self._runners_endpoint.create(arguments)
runner = self._gitlab.runners.create(arguments)
except (gitlab.exceptions.GitlabCreateError) as e:
self._module.fail_json(msg="Failed to create runner: %s " % to_native(e))

Expand Down Expand Up @@ -292,10 +292,10 @@ def find_runner(self, description, owned=False):
# object, so we need to handle both
if hasattr(runner, "description"):
if (runner.description == description):
return self._runners_endpoint.get(runner.id)
return self._gitlab.runners.get(runner.id)
else:
if (runner['description'] == description):
return self._runners_endpoint.get(runner['id'])
return self._gitlab.runners.get(runner['id'])

'''
@param description Description of the runner
Expand Down