mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-04-23 10:51:24 -07:00
Feature/gitlab deploykey updkey (#1661)
* feat(gitlab-deploy-key): automatically update ... ... the public key * add integrity test * fix sanity issues * added changelog fragment Co-authored-by: Mirko Wilhelmi <Mirko.Wilhelmi@sma.de>
This commit is contained in:
parent
f509f2c896
commit
dd0b54b9b5
4 changed files with 45 additions and 0 deletions
|
@ -145,6 +145,13 @@ class GitLabDeployKey(object):
|
|||
def createOrUpdateDeployKey(self, project, key_title, key_key, options):
|
||||
changed = False
|
||||
|
||||
# note: unfortunately public key cannot be updated directly by
|
||||
# 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()
|
||||
self.deployKeyObject = None
|
||||
|
||||
# Because we have already call existsDeployKey in main()
|
||||
if self.deployKeyObject is None:
|
||||
deployKey = self.createDeployKey(project, {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue