Skip to content

Commit

Permalink
Merge pull request #1608 from wdpypere/zookeeper
Browse files Browse the repository at this point in the history
ncm-metaconfig: zookeeper: fix 4lw options to a list of choice
  • Loading branch information
jrha committed Jul 27, 2023
2 parents 8bc14a6 + 72eaacc commit 536f291
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 1 deletion.
3 changes: 2 additions & 1 deletion ncm-metaconfig/src/main/metaconfig/zookeeper/pan/schema.pan
Expand Up @@ -22,7 +22,8 @@ type zookeeper_main = {
"autopurge.snapRetainCount" ? long
"autopurge.purgeInterval" ? long
"syncEnabled" ? boolean
"4lw.commands.whitelist" ? string
"4lw.commands.whitelist" ? choice('conf', 'cons', 'crst', 'dump', 'envi', 'mntr',
'ruok', 'srst', 'srvr', 'stat', 'wchc', 'wchp', 'wchs') []

# cluster/ensemble
"initLimit" : long = 10
Expand Down
3 changes: 3 additions & 0 deletions ncm-metaconfig/src/main/metaconfig/zookeeper/server.tt
@@ -1,9 +1,12 @@
[%- booleans = ["leaderServes", "syncEnabled"] -%]
[%- lists = ["4lw.commands.whitelist",] -%]
[%- FOREACH pair IN main.pairs -%]
[% pair.key %]=
[%- SWITCH pair.key -%]
[%- CASE booleans -%]
[%- pair.value ? "yes" : "no" %]
[%- CASE lists -%]
[%- pair.value.join(', ') %]
[%- CASE -%]
[%- pair.value %]
[%- END %]
Expand Down
Expand Up @@ -4,6 +4,8 @@ include 'metaconfig/zookeeper/config';

prefix "/software/components/metaconfig/services/{/etc/zookeeper/zoo.cfg}/contents";
"main/dataDir" = "/var/lib/zookeeper";
"main/4lw.commands.whitelist" = list("stat" , "srvr" , "mntr");

"servers" = list(
dict("hostname", "host1.domain"),
dict("hostname", "host2.domain"),
Expand Down
Expand Up @@ -3,6 +3,7 @@ Values test for zookeeper main server config
multiline
metaconfigservice=/etc/zookeeper/zoo.cfg
---
^4lw.commands.whitelist=stat, srvr, mntr$
^clientPort=2181$
^dataDir=/var/lib/zookeeper$
^initLimit=10$
Expand Down

0 comments on commit 536f291

Please sign in to comment.