Skip to content

Commit 90b0fb5

Browse files
committed
configure: fix problem when configuring gpg twice
When doing an SS reset and configuring a GPG space, the task was failing due to gpg_fingerprint not being defined
1 parent 526aefe commit 90b0fb5

File tree

1 file changed

+18
-1
lines changed

1 file changed

+18
-1
lines changed

tasks/configure-gpg.yml

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@
6666
become_user: "archivematica"
6767
when: gpg_key_already_exist.rc != 0
6868

69-
- name: "Create GPG Space"
69+
- name: "Create GPG Space (new key)"
7070
uri:
7171
url: "{{ archivematica_src_configure_ss_url }}/api/v2/space/"
7272
headers:
@@ -80,6 +80,23 @@
8080
body_format: json
8181
status_code: 201
8282
method: POST
83+
when: gpg_key_already_exist.rc != 0
84+
85+
- name: "Create GPG Space (existing key)"
86+
uri:
87+
url: "{{ archivematica_src_configure_ss_url }}/api/v2/space/"
88+
headers:
89+
Content-Type: "application/json"
90+
Authorization: "ApiKey {{ archivematica_src_configure_ss_user }}:{{ archivematica_src_configure_ss_api_key }}"
91+
body:
92+
access_protocol: "GPG"
93+
path: "/"
94+
staging_path: "{{ archivematica_src_configure_gpg.space_staging_directory }}"
95+
key: "{{ gpg_key_already_exist.stdout }}"
96+
body_format: json
97+
status_code: 201
98+
method: POST
99+
when: gpg_key_already_exist.rc == 0
83100

84101
- name: "List GPG Spaces from API"
85102
uri:

0 commit comments

Comments
 (0)