docs: fix hcl use on production acls guide (#6739)

Also clean up some general whitespace formatting.
pull/6732/head
R.B. Boyer 2019-11-04 11:11:59 -06:00 committed by GitHub
parent ff8157fb51
commit dc4b3e3444
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 52 additions and 53 deletions

View File

@ -45,10 +45,10 @@ on them when you apply the token.
# agent.hcl
{
acl = {
enabled = true,
default_policy = "deny",
enabled = true
default_policy = "deny"
enable_token_persistence = true
}
}
}
```
@ -233,7 +233,7 @@ definition](https://www.consul.io/docs/agent/services.html).
```sh
# dashboard-policy.hcl
service "dashboard" {
policy = "write"
policy = "write"
}
```
@ -259,18 +259,18 @@ Finally, add the token to the service definition.
```
{
"service": {
"name": "dashboard",
"port": 9002,
"token": "57c5d69a-5f19-469b-0543-12a487eecc66",
"check": {
"id": "dashboard-check",
"http": "http://localhost:9002/health",
"method": "GET",
"interval": "1s",
"timeout": "1s"
}
}
}
"name": "dashboard",
"port": 9002,
"token": "57c5d69a-5f19-469b-0543-12a487eecc66",
"check": {
"id": "dashboard-check",
"http": "http://localhost:9002/health",
"method": "GET",
"interval": "1s",
"timeout": "1s"
}
}
}
```
If the service is running, you will need to restart it. Unlike with agent
@ -302,14 +302,14 @@ nodes, and prepared queries.
```
# dns-request-policy.hcl
node_prefix "" {
policy = "read"
policy = "read"
}
service_prefix "" {
policy = "read"
policy = "read"
}
# only needed if using prepared queries
query_prefix "" {
policy = "read"
policy = "read"
}
```
@ -337,9 +337,8 @@ The data file must contain a valid token.
```
# dns-token.json
{
"Token":"5467d69a-5f19-469b-0543-12a487eecc66"
"Token": "5467d69a-5f19-469b-0543-12a487eecc66"
}
```
Note, if you have multiple agents serving DNS requests you can use the same
@ -444,13 +443,13 @@ not even to view the token you used to access the UI.
# operator-ui.hcl
service_prefix "" {
policy = "read"
}
}
key_prefix "" {
policy = "read"
}
}
node_prefix "" {
policy = "read"
}
}
```
## Summary