I try to retrieve a certificate from Vault server.
So, my playbook look like this:
- name: Get Certificate from Vault, using Vault Module
hosts: localhost
tasks:
- name: Issue cert from Vault
community.hashi_vault.vault_pki_generate_certificate:
common_name: "Censored-CA"
role_name: censored-role
engine_mount_point: "pki/censored-ca"
url: https://vault.censored.censor
register: data_response
- name: Display the result
ansible.builtin.debug:
msg: " test {{ data_response }}"
but I got this
PLAY [Get Certificate from Vault, using Vault Module] **************************************************************************************************************************************
TASK [Gathering Facts] *********************************************************************************************************************************************************************
ok: [localhost]
TASK [Login and use the resulting Token] ***************************************************************************************************************************************************
changed: [localhost]
TASK [Issue cert from Vault] ***************************************************************************************************************************************************************
An exception occurred during task execution. To see the full traceback, use -vvv. The error was: , on post https://vault.censored.censor/v1/pki/censored-ca/issue/role-censored
fatal: [localhost]: FAILED! => {
"changed": false
}
MSG:
1 error occurred:
* could not fetch the CA certificate (was one set?): unable to fetch corresponding key for issuer issuer_censored ; unable to use this issuer for signing
, on post https://vault.censored.censor/v1/pki/censored-ca/issue/role-censored
PLAY RECAP *********************************************************************************************************************************************************************************
localhost : ok=2 changed=1 unreachable=0 failed=1 skipped=0 rescued=0 ignored=0
Please, can you help me? I feel lost. I look at the documentation but I can’t figure out. I will be very thankful if you help me or give me guidance. Thanks in advance.