Skip to content

Commit 9810212

Browse files
committed
Fix idempotency of intermediate certificates
Prior to this change running the vault_pki role multiple times when generating an intermediate certificate could result in the following error: TASK [vault_pki : Set Intermediate as signed] ********************************** fatal: [localhost]: FAILED! => msg: |- The task includes an option with an undefined variable. The error was: 'dict object' has no attribute 'data' The error appears to be in 'roles/vault_pki/tasks/intermediate.yml': line 45, column 7, but may be elsewhere in the file depending on the exact syntax problem. The offending line appears to be: - name: "Set Intermediate as signed" ^ here This change adds the same condition used in other tasks.
1 parent 131714f commit 9810212

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

roles/vault_pki/tasks/intermediate.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,8 @@
5353
{{ intermediate_ca_csr_signed.data.issuing_ca }}
5454
when:
5555
- not vault_pki_intermediate_export | bool
56+
- intermediate_ca_csr.changed
57+
- intermediate_ca_csr.data is defined
5658

5759
- name: "Set Exported Intermediate as signed"
5860
hashivault_pki_ca_set:
@@ -78,6 +80,8 @@
7880
delegate_to: "{{ vault_pki_write_certificates_host }}"
7981
when:
8082
- vault_pki_write_int_ca_to_file | bool
83+
- intermediate_ca_csr.changed
84+
- intermediate_ca_csr.data is defined
8185

8286
- name: "Write out Intermediate Certs and keys to file"
8387
copy:

0 commit comments

Comments
 (0)