The task importing the client private key referenced `certificate_authority_client_ca_path`, a variable that is declared neither in `defaults/main.yaml` nor in `meta/argument_specs.yaml`. Every run with `certificate_authority_client_create: false` therefore aborted with an undefined variable error before the key was written. Use the actual role variable `certificate_authority_client_path` instead. Co-authored-by: Copilot <copilot@github.com>
20 lines
638 B
YAML
20 lines
638 B
YAML
---
|
|
|
|
- name: Import private key of a client
|
|
ansible.builtin.copy:
|
|
content: "{{ certificate_authority_client_tls_key_content }}"
|
|
dest: "{{ certificate_authority_client_path }}/privkey.pem"
|
|
owner: "root"
|
|
group: "root"
|
|
mode: "0600"
|
|
when: certificate_authority_client_tls_key_content | length > 0
|
|
|
|
- name: Import certificate of a client
|
|
ansible.builtin.copy:
|
|
content: "{{ certificate_authority_client_tls_crt_content }}"
|
|
dest: "{{ certificate_authority_client_tls_crt_content }}/cert.pem"
|
|
owner: "root"
|
|
group: "root"
|
|
mode: "0644"
|
|
when: certificate_authority_client_tls_crt_content | length > 0
|