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:
morco 2021-02-05 07:30:05 +01:00 committed by GitHub
commit dd0b54b9b5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 45 additions and 0 deletions

View file

@ -39,3 +39,35 @@
- assert:
that:
- deploy_key_status is changed
- deploy_key_status.deploy_key.key == gitlab_deploy_key
- name: Update public key {{ gitlab_project_name }} (change expected)
gitlab_deploy_key:
login_token: "{{ gitlab_login_token }}"
project: "root/{{ gitlab_project_name }}"
server_url: "{{ gitlab_host }}"
title: "{{ gitlab_project_name }}"
key: "{{ gitlab_deploy_key_new }}"
state: present
register: deploy_key_status
- assert:
that:
- deploy_key_status is changed
- deploy_key_status.deploy_key.key == gitlab_deploy_key_new
- name: Update public key {{ gitlab_project_name }} (no change expected)
gitlab_deploy_key:
login_token: "{{ gitlab_login_token }}"
project: "root/{{ gitlab_project_name }}"
server_url: "{{ gitlab_host }}"
title: "{{ gitlab_project_name }}"
key: "{{ gitlab_deploy_key_new }}"
state: present
register: deploy_key_status
- assert:
that:
- not deploy_key_status.changed
- deploy_key_status.deploy_key.key == gitlab_deploy_key_new