mirror of https://github.com/hashicorp/consul
docs: fix hcl use on production acls guide (#6739)
Also clean up some general whitespace formatting.pull/6732/head
parent
ff8157fb51
commit
dc4b3e3444
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue