Use new Vault CLI commands in guides

This commit is contained in:
Alex Dadgar 2018-04-11 12:51:36 -07:00
parent 28d6c3757f
commit 2ccaebe815
3 changed files with 7 additions and 7 deletions

View File

@ -14,9 +14,9 @@ for the Nomad servers (must be in nomad/dev/vault):
```shell
export VAULT_ADDR='http://127.0.0.1:8200'
vault policy-write nomad-server nomad-server-policy.hcl
vault policy write nomad-server nomad-server-policy.hcl
vault write /auth/token/roles/nomad-cluster @nomad-cluster-role.json
vault token-create -policy nomad-server -period 72h -orphan
vault token create -policy nomad-server -period 72h -orphan
```
You can then run Nomad using the generated token. An example would be:

View File

@ -115,7 +115,7 @@ available for download. Below is an example of writing this policy to Vault:
$ curl https://nomadproject.io/data/vault/nomad-server-policy.hcl -O -s -L
# Write the policy to Vault
$ vault policy-write nomad-server nomad-server-policy.hcl
$ vault policy write nomad-server nomad-server-policy.hcl
```
#### Vault Token Role Configuration
@ -230,7 +230,7 @@ $ curl https://nomadproject.io/data/vault/nomad-server-policy.hcl -O -s -L
$ curl https://nomadproject.io/data/vault/nomad-cluster-role.json -O -s -L
# Write the policy to Vault
$ vault policy-write nomad-server nomad-server-policy.hcl
$ vault policy write nomad-server nomad-server-policy.hcl
# Create the token role with Vault
$ vault write /auth/token/roles/nomad-cluster @nomad-cluster-role.json
@ -242,7 +242,7 @@ After the token role is created, a token suitable for the Nomad servers may be
retrieved by issuing the following Vault command:
```
$ vault token-create -policy nomad-server -period 72h -orphan
$ vault token create -policy nomad-server -period 72h -orphan
Key Value
--- -----
token f02f01c2-c0d1-7cb7-6b88-8a14fada58c0

View File

@ -465,7 +465,7 @@ role:
```
$ echo 'path "nomad/creds/role-name" {
capabilities = ["read"]
}' | vault policy-write nomad-user-policy -
}' | vault policy write nomad-user-policy -
Policy 'nomad-user-policy' written.
```
@ -474,7 +474,7 @@ a role available on the [Authentication backends page](https://www.vaultproject.
Otherwise, for testing purposes, a Vault token can be generated associated with the policy:
```
$ vault token-create -policy=nomad-user-policy
$ vault token create -policy=nomad-user-policy
Key Value
--- -----
token deedfa83-99b5-34a1-278d-e8fb76809a5b