Last active
December 26, 2015 09:49
-
-
Save justlooks/7132325 to your computer and use it in GitHub Desktop.
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
CM3: | |
---------- | |
State: - pkgrepo | |
Name: mycluster | |
Function: managed | |
Result: True | |
Comment: Package repo mycluster already configured | |
Changes: | |
---------- | |
State: - pkg | |
Name: zkpkgs | |
Function: installed | |
Result: True | |
Comment: All specified packages are already installed. | |
Changes: | |
---------- | |
State: - file | |
Name: /etc/zookeeper/conf/zoo.cfg | |
Function: managed | |
Result: True | |
Comment: File /etc/zookeeper/conf/zoo.cfg is in the correct state | |
Changes: | |
mycluster: | |
pkgrepo.managed: | |
- humanname: chuanghe local cluster repo cdh4.3 | |
- name: mycluster | |
- baseurl: http://192.168.142.128/cloudera-cdh4/ | |
- gpgcheck: 0 | |
zkpkgs: | |
pkg.installed: | |
- skip_verify: False | |
- pkgs: | |
- zookeeper | |
- zookeeper-server | |
- require: | |
- pkgrepo: mycluster | |
/etc/zookeeper/conf/zoo.cfg: | |
file.managed: | |
- source: salt://zookeeper/zoo.cfg | |
- template: jinja | |
- require: | |
- pkg: zkpkgs | |
- defaults: | |
maxcliconns: {{pillar['maxcliconns']}} | |
ticktime: {{pillar['ticktime']}} | |
initlimit: {{pillar['initlimit']}} | |
synclimit: {{pillar['synclimit']}} | |
datadir: {{pillar['datadir']}} | |
clientport: {{pillar['clientport']}} | |
{% if not salt['file.file_exists'](pillar['datadir']~'/myid') %} | |
zkinit: | |
cmd.run: | |
- name: service zookeeper-server init --myid {% for i in pillar['cluster'] %}{% if i[2:] == grains['ip_interfaces']['eth0'][0] %}{{i[0:1]}}{% endif %}{% endfor %} | |
- require: | |
- file: /etc/zookeeper/conf/zoo.cfg | |
{% endif %} | |
zookeeper-server: | |
service: | |
- running | |
- require: | |
- file: {{pillar['datadir']~'/myid'}} # it cause problem because no such state exist |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment