File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ # Make sure you are in the m7 directory or this won't work very well
2+
3+ # Make sure your Vault server container is up and running
4+ docker container ls
5+
6+ # Let's set our vault env variables
7+ $env: VAULT_ADDR = " https://127.0.0.1:8200"
8+ $env: VAULT_SKIP_VERIFY = " true"
9+
10+ # Make sure vault isn't sealed
11+ vault status
12+ vault login
13+
14+ # We need to get the role-id and secret-id for the vault agent
15+ $role_id = $ (vault read auth/ approle/ role/ web- role/ role- id - format= json) | ConvertFrom-Json
16+
17+ $secret_id = $ (vault write -f auth/ approle/ role/ web- role/ secret- id - format= json) | ConvertFrom-Json
18+
19+ # Now we'll write both values out to files for use by the agent
20+ $role_id.data.role_id > role_id.txt
21+ $secret_id.data.secret_id > secret_id.txt
22+
23+ # Next we'll put a secret into the apikeys secrets engine
24+ vault kv put apikeys/ key1 key= 456yujnbgty678ikjhgty67u
25+
26+ # And now we can start up the vault agent
27+ vault agent - config= vault- agent.hcl
You can’t perform that action at this time.
0 commit comments