diff --git a/changelogs/fragments/3473-gitlab_deploy_key-fix_idempotency.yml b/changelogs/fragments/3473-gitlab_deploy_key-fix_idempotency.yml new file mode 100644 index 0000000000..45dc8f9641 --- /dev/null +++ b/changelogs/fragments/3473-gitlab_deploy_key-fix_idempotency.yml @@ -0,0 +1,2 @@ +bugfixes: + - gitlab_deploy_key - fix idempotency on projects with multiple deploy keys (https://github.com/ansible-collections/community.general/pull/3473). diff --git a/plugins/modules/source_control/gitlab/gitlab_deploy_key.py b/plugins/modules/source_control/gitlab/gitlab_deploy_key.py index 1174718e68..91a7df26b3 100644 --- a/plugins/modules/source_control/gitlab/gitlab_deploy_key.py +++ b/plugins/modules/source_control/gitlab/gitlab_deploy_key.py @@ -204,7 +204,7 @@ class GitLabDeployKey(object): @param key_title Title of the key ''' def findDeployKey(self, project, key_title): - deployKeys = project.keys.list() + deployKeys = project.keys.list(all=True) for deployKey in deployKeys: if (deployKey.title == key_title): return deployKey