Skip to content

Instantly share code, notes, and snippets.

@justlooks
Created October 21, 2013 07:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save justlooks/7079759 to your computer and use it in GitHub Desktop.
Save justlooks/7079759 to your computer and use it in GitHub Desktop.
error output
# salt 'ch11' state.sls zookeeper
ch11:
----------
State: - pkg
Name: zookeeper
Function: installed
Result: True
Comment: Package zookeeper is already installed
Changes:
----------
State: - file
Name: /etc/zookeeper/conf/zoo.cfg
Function: managed
Result: False
Comment: unknown tag 'idx'; line 11 in template
Changes:
my file context
maxClientCnxns={{maxcliconns}}
tickTime={{ticktime}}
initLimit={{initlimit}}
syncLimit={{synclimit}}
dataDir={{datadir}}
clientPort={{clientport}}
{% for i in pillar['cluster'] %}
{% set idx=0 %}
{{'server.'~idx~'='~i~':2888:3888'}}
{% idx=idx+1 %}
{% endfor %}
and my sls file
zookeeper:
pkg.installed:
- skip_verify: False
/etc/zookeeper/conf/zoo.cfg:
file.managed:
- source: salt://zookeeper/zoo.cfg
- template: jinja
- require:
- pkg: zookeeper
- defaults:
maxcliconns: {{pillar['maxcliconns']}}
ticktime: {{pillar['ticktime']}}
initlimit: {{pillar['initlimit']}}
synclimit: {{pillar['synclimit']}}
datadir: {{pillar['datadir']}}
clientport: {{pillar['clientport']}}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment