ddd
This commit is contained in:
parent
21838a27f5
commit
b7c2464a7e
|
@ -4,7 +4,7 @@
|
||||||
|
|
||||||
- name: Copy CA file to local Trusted root CA store
|
- name: Copy CA file to local Trusted root CA store
|
||||||
copy: src="ca.crt" dest="/etc/ssl/certs/my-ca.crt"
|
copy: src="ca.crt" dest="/etc/ssl/certs/my-ca.crt"
|
||||||
#ags: certificate
|
tags: certificate
|
||||||
|
|
||||||
#Step1 - Check if certificate file is in place
|
#Step1 - Check if certificate file is in place
|
||||||
- name: Check that the host certificate exists
|
- name: Check that the host certificate exists
|
||||||
|
|
|
@ -8,7 +8,7 @@ CERTNAME=$(hostname).{{local_domainname}}
|
||||||
curl --header "X-Vault-Token: $VAULT_TOKEN" \
|
curl --header "X-Vault-Token: $VAULT_TOKEN" \
|
||||||
--request POST \
|
--request POST \
|
||||||
--data '{"common_name": "'$CERTNAME'", "ttl": "43800h"}' \
|
--data '{"common_name": "'$CERTNAME'", "ttl": "43800h"}' \
|
||||||
$VAULT_ADDR/v1/interca/issue/{{vaultStoreName}} > certificateResult.txt
|
$VAULT_ADDR/v1/rootca_store/issue/{{vaultStoreRole}} > certificateResult.txt
|
||||||
|
|
||||||
jq .data.private_key certificateResult.txt | sed "s/\"//g" | sed "s/\\\n/\n/g" > cert.pem
|
jq .data.private_key certificateResult.txt | sed "s/\"//g" | sed "s/\\\n/\n/g" > cert.pem
|
||||||
jq .data.certificate certificateResult.txt | sed "s/\"//g" | sed "s/\\\n/\n/g" > cert.crt
|
jq .data.certificate certificateResult.txt | sed "s/\"//g" | sed "s/\\\n/\n/g" > cert.crt
|
||||||
|
@ -21,4 +21,3 @@ mv ca.crt /etc/ssl/certs/{{local_domainname}}-CA-chain.crt
|
||||||
|
|
||||||
|
|
||||||
#rm certificateResult.txt
|
#rm certificateResult.txt
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue