mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-06 21:32:49 +00:00
fix gitlab_deploy_key task in check mode (#3622)
fixes #3621 * running check mode used to accidentally delete the existing ssh key; change it so deletion is skipped in check mode
This commit is contained in:
@@ -149,7 +149,8 @@ class GitLabDeployKey(object):
|
||||
# GitLab REST API, so for that case we need to delete and
|
||||
# than recreate the key
|
||||
if self.deployKeyObject and self.deployKeyObject.key != key_key:
|
||||
self.deployKeyObject.delete()
|
||||
if not self._module.check_mode:
|
||||
self.deployKeyObject.delete()
|
||||
self.deployKeyObject = None
|
||||
|
||||
# Because we have already call existsDeployKey in main()
|
||||
|
||||
Reference in New Issue
Block a user