Fernando K pushed to branch main at Root / Serviços / DNS
Commits:
-
f3ff3e95
by Fernando Monteiro Kiotheka at 2025-08-06T15:32:32-03:00
1 changed file:
Changes:
... | ... | @@ -3,10 +3,9 @@ response=$(curl --no-progress-meter --request POST \ |
3 | 3 | --header "X-Vault-Token: $VAULT_TOKEN" --data '{"key_type": "ed25519"}' \
|
4 | 4 | "$VAULT_ADDR/v1/ssh-client-signer/issue/ansible") \
|
5 | 5 | || { echo "Failed to retrieve SSH key: Request to Vault failed"; exit 1; }
|
6 | -echo $response
|
|
7 | 6 | private_key=$(printf "%s" "$response" | jq --raw-output .data.private_key)
|
8 | 7 | signed_key=$(printf "%s" "$response" | jq --raw-output .data.signed_key)
|
9 | 8 | [ "$signed_key" != "null" ] && [ "$private_key" != "null" ] \
|
10 | 9 | || { echo "Failed to retrieve SSH key: SSH key is empty"; exit 1; }
|
11 | -printf "%s" "$private_key" >key && chmod 600 key
|
|
12 | -printf "%s" "$signed_key" >key-cert.pub && chmod 644 key-cert.pub |
|
10 | +printf "%s\n" "$private_key" >key && chmod 600 key
|
|
11 | +printf "%s\n" "$signed_key" >key-cert.pub && chmod 644 key-cert.pub |