Merge pull request #1651 from bradbeam/vaultnocontent
Fixing condition where vault CA already exists
This commit is contained in:
commit
f2ae16e71d
1 changed files with 3 additions and 0 deletions
|
@ -12,6 +12,7 @@
|
||||||
method: POST
|
method: POST
|
||||||
body_format: json
|
body_format: json
|
||||||
body: "{{ gen_ca_vault_options }}"
|
body: "{{ gen_ca_vault_options }}"
|
||||||
|
status_code: 200,204
|
||||||
register: vault_ca_gen
|
register: vault_ca_gen
|
||||||
delegate_to: "{{ groups.vault|first }}"
|
delegate_to: "{{ groups.vault|first }}"
|
||||||
run_once: true
|
run_once: true
|
||||||
|
@ -21,9 +22,11 @@
|
||||||
content: "{{ hostvars[groups.vault|first]['vault_ca_gen']['json']['data']['certificate'] }}"
|
content: "{{ hostvars[groups.vault|first]['vault_ca_gen']['json']['data']['certificate'] }}"
|
||||||
dest: "{{ gen_ca_cert_dir }}/ca.pem"
|
dest: "{{ gen_ca_cert_dir }}/ca.pem"
|
||||||
mode: 0644
|
mode: 0644
|
||||||
|
when: vault_ca_gen.status == 200
|
||||||
|
|
||||||
- name: "bootstrap/gen_ca | Copy {{ gen_ca_mount_path }} root CA key locally"
|
- name: "bootstrap/gen_ca | Copy {{ gen_ca_mount_path }} root CA key locally"
|
||||||
copy:
|
copy:
|
||||||
content: "{{ hostvars[groups.vault|first]['vault_ca_gen']['json']['data']['private_key'] }}"
|
content: "{{ hostvars[groups.vault|first]['vault_ca_gen']['json']['data']['private_key'] }}"
|
||||||
dest: "{{ gen_ca_cert_dir }}/ca-key.pem"
|
dest: "{{ gen_ca_cert_dir }}/ca-key.pem"
|
||||||
mode: 0640
|
mode: 0640
|
||||||
|
when: vault_ca_gen.status == 200
|
||||||
|
|
Loading…
Reference in a new issue