|
12 | 12 | max_lease_ttl: "{{ vault_pki_intermediate_max_lease_ttl }}" |
13 | 13 |
|
14 | 14 | - name: "Generate Intermediate CA cert, key and sign CSR" |
| 15 | + when: not vault_pki_intermediate_import | bool |
15 | 16 | block: |
16 | 17 | - name: "Generate Vault Intermediate CA cert and key" |
17 | 18 | hashivault_pki_ca: |
|
73 | 74 | content: | |
74 | 75 | {{ intermediate_ca_csr_signed.data.certificate }} |
75 | 76 | dest: "{{ vault_pki_certificates_directory }}/{{ vault_pki_intermediate_ca_name | replace(' ', '-') }}.crt" |
76 | | - mode: 0600 |
| 77 | + mode: "0600" |
77 | 78 | delegate_to: "{{ vault_pki_write_certificates_host }}" |
78 | 79 | when: |
79 | 80 | - vault_pki_write_int_ca_to_file | bool |
|
85 | 86 | {{ intermediate_ca_csr_signed.data.issuing_ca }} |
86 | 87 | {{ intermediate_ca_csr.data.private_key }} |
87 | 88 | dest: "{{ vault_pki_certificates_directory }}/{{ vault_pki_intermediate_ca_name |replace(' ', '-') }}.pem" |
88 | | - mode: 0600 |
| 89 | + mode: "0600" |
89 | 90 | delegate_to: "{{ vault_pki_write_certificates_host }}" |
90 | 91 | when: |
91 | 92 | - vault_pki_intermediate_export | bool |
92 | 93 | - intermediate_ca_csr.changed |
93 | 94 | - intermediate_ca_csr.data is defined |
94 | 95 | - intermediate_ca_csr_signed.data is defined |
95 | 96 |
|
96 | | - when: not vault_pki_intermediate_import | bool |
97 | 97 |
|
98 | 98 | - name: "Import Intermediate CA cert and key" |
| 99 | + when: vault_pki_intermediate_import | bool |
99 | 100 | block: |
100 | 101 | - name: "Import Intermediate CA cert and key" |
101 | 102 | hashivault_pki_ca_set: |
|
104 | 105 | ca_cert: "{{ vault_ca_cert | default(omit) }}" |
105 | 106 | mount_point: "{{ vault_pki_intermediate_ca_name }}" |
106 | 107 | pem_bundle: "{{ vault_pki_intermediate_ca_bundle }}" |
107 | | - |
108 | | - when: vault_pki_intermediate_import | bool |
0 commit comments