-
Notifications
You must be signed in to change notification settings - Fork 4.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update policy to template the Nomad node name in.
- Loading branch information
1 parent
af26f0e
commit 87c87db
Showing
9 changed files
with
20 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
agent_prefix "" { | ||
policy = "read" | ||
} | ||
node_prefix "" { | ||
node "{{.Name}}" { | ||
policy = "write" | ||
} | ||
service_prefix "" { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...mplatedpolicy/testdata/FormatTemplatedPolicy/ce/nomad-client-templated-policy.json.golden
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
{ | ||
"TemplateName": "builtin/nomad-client", | ||
"Schema": "", | ||
"Template": "agent_prefix \"\" {\n policy = \"read\"\n}\nnode_prefix \"\" {\n policy = \"write\"\n}\nservice_prefix \"\" {\n policy = \"write\"\n}\nkey_prefix \"\" {\n policy = \"read\"\n}", | ||
"Template": "agent_prefix \"\" {\n policy = \"read\"\n}\nnode \"{{.Name}}\" {\n policy = \"write\"\n}\nservice_prefix \"\" {\n policy = \"write\"\n}\nkey_prefix \"\" {\n policy = \"read\"\n}", | ||
"Description": "Gives the token or role permissions required for integration with a nomad client." | ||
} |
7 changes: 4 additions & 3 deletions
7
...policy/testdata/FormatTemplatedPolicy/ce/nomad-client-templated-policy.pretty-meta.golden
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 3 additions & 2 deletions
5
...latedpolicy/testdata/FormatTemplatedPolicy/ce/nomad-client-templated-policy.pretty.golden
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
Name: builtin/nomad-client | ||
Description: Gives the token or role permissions required for integration with a nomad client. | ||
Input variables: None | ||
Input variables: | ||
Name: String - Required - The node name. | ||
Example usage: | ||
consul acl token create -templated-policy builtin/nomad-client | ||
consul acl token create -templated-policy builtin/nomad-client -var name:node-1 |
2 changes: 1 addition & 1 deletion
2
...mplatedpolicy/testdata/FormatTemplatedPolicy/ce/nomad-server-templated-policy.json.golden
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
{ | ||
"TemplateName": "builtin/nomad-server", | ||
"Schema": "", | ||
"Template": "\nacl = \"write\"\nmesh = \"write\"\n\nagent_prefix \"\" {\n policy = \"read\"\n}\nnode_prefix \"\" {\n policy = \"write\"\n}\nservice_prefix \"\" {\n policy = \"write\"\n}", | ||
"Template": "\nacl = \"write\"\nmesh = \"write\"\n\nagent_prefix \"\" {\n policy = \"read\"\n}\nnode \"{{.Name}}\" {\n policy = \"write\"\n}\nservice_prefix \"\" {\n policy = \"write\"\n}", | ||
"Description": "Gives the token or role permissions required for integration with a nomad server." | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 3 additions & 2 deletions
5
...latedpolicy/testdata/FormatTemplatedPolicy/ce/nomad-server-templated-policy.pretty.golden
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
Name: builtin/nomad-server | ||
Description: Gives the token or role permissions required for integration with a nomad server. | ||
Input variables: None | ||
Input variables: | ||
Name: String - Required - The node name. | ||
Example usage: | ||
consul acl token create -templated-policy builtin/nomad-server | ||
consul acl token create -templated-policy builtin/nomad-server -var name:node-1 |