mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02: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:
parent
3a2f52c1db
commit
8ba7fd5d61
2 changed files with 4 additions and 1 deletions
|
@ -0,0 +1,2 @@
|
||||||
|
bugfixes:
|
||||||
|
- gitlab_deploy_key - fix the SSH Deploy Key being deleted accidentally while running task in check mode (https://github.com/ansible-collections/community.general/issues/3621, https://github.com/ansible-collections/community.general/pull/3622).
|
|
@ -149,6 +149,7 @@ class GitLabDeployKey(object):
|
||||||
# GitLab REST API, so for that case we need to delete and
|
# GitLab REST API, so for that case we need to delete and
|
||||||
# than recreate the key
|
# than recreate the key
|
||||||
if self.deployKeyObject and self.deployKeyObject.key != key_key:
|
if self.deployKeyObject and self.deployKeyObject.key != key_key:
|
||||||
|
if not self._module.check_mode:
|
||||||
self.deployKeyObject.delete()
|
self.deployKeyObject.delete()
|
||||||
self.deployKeyObject = None
|
self.deployKeyObject = None
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue