Skip to content

Approle

Création

vault write auth/approle/role/ansible-checkmk \
token_ttl=1m \
token_max_ttl=1m \
token_policies=ansible-checkmk \
secret_id_bound_cidrs=10.0.0.23/32

Utilisation

On récupère l'id et le secret

vault read auth/approle/role/ansible-checkmk/role-id
vault write -f auth/approle/role/ansible-checkmk/secret-id

On l'utilise

export VAULT_ADDR="https://vault.slashroot.fr"
ROLE_ID="*************************"
SECRET_ID="**********************"
export VAULT_TOKEN=$(vault write auth/approle/login role_id=$ROLE_ID secret_id=$SECRET_ID -format=json | jq -r .auth.client_token)
vault kv get -field=automation dsi/infra/monitoring/checkmk