diff --git a/changelogs/fragments/10918-gitlab-runner-fix-check-mode.yml b/changelogs/fragments/10918-gitlab-runner-fix-check-mode.yml new file mode 100644 index 0000000000..214487938b --- /dev/null +++ b/changelogs/fragments/10918-gitlab-runner-fix-check-mode.yml @@ -0,0 +1,2 @@ +bugfixes: + - gitlab_runner - fix exception in check mode when a new runner is created (https://github.com/ansible-collections/community.general/issues/8854). diff --git a/plugins/modules/gitlab_runner.py b/plugins/modules/gitlab_runner.py index 032f374b4e..889e2471cc 100644 --- a/plugins/modules/gitlab_runner.py +++ b/plugins/modules/gitlab_runner.py @@ -343,7 +343,10 @@ class GitLabRunner(object): ''' def create_runner(self, arguments): if self._module.check_mode: - return True + class MockRunner: + def __init__(self): + self._attrs = {} + return MockRunner() try: if arguments.get('token') is not None: