This commit is contained in:
Cory Hawkless 2020-08-26 00:45:38 +09:30
parent 21838a27f5
commit b7c2464a7e
2 changed files with 2 additions and 3 deletions

View File

@ -4,7 +4,7 @@
- name: Copy CA file to local Trusted root CA store
copy: src="ca.crt" dest="/etc/ssl/certs/my-ca.crt"
#ags: certificate
tags: certificate
#Step1 - Check if certificate file is in place
- name: Check that the host certificate exists

View File

@ -8,7 +8,7 @@ CERTNAME=$(hostname).{{local_domainname}}
curl --header "X-Vault-Token: $VAULT_TOKEN" \
--request POST \
--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.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