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
parent f509f2c896
commit dd0b54b9b5
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