Skip to content

Commit

Permalink
Merge pull request voxpupuli#487 from spuder/patch-1
Browse files Browse the repository at this point in the history
Clarify how to use the new acl system
  • Loading branch information
solarkennedy committed Jul 28, 2019
2 parents b04670f + 71daf99 commit a9ca7f1
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,34 @@ consul_token {'test_token':
],
}
```
Here is an exmaple to automatically create a policy and acl for each host.
For development environments `acl_api_token` can be the bootstrap token. For production it should be a dedicated token with access to write/read from the acls.

```
# Crate ACL policy that allows nodes to update themselves and read others
consul_policy { $::hostname:
description => "${::hostname}, generated by puppet",
rules => [
{
'resource' => 'node',
'segment' => "$::hostname",
'disposition' => 'write'
},
{
'resource' => 'node',
'segment' => '',
'disposition' => 'read'
}
],
acl_api_token => $acl_api_token
}
consul_token { $::hostname:
policies_by_name => ["${::hostname}"],
acl_api_token => $acl_api_token,
}
```

Predefining token secret is supported by setting secret_id property.

Externally created tokens and policies may be used by referencing them by ID (Token: accessor_id property, Policy: ID property, linking: policies_by_id property)
Expand Down

0 comments on commit a9ca7f1

Please sign in to comment.