-
-
Save UtahDave/9623f597dbd38f4c55ae to your computer and use it in GitHub Desktop.
An example of using the riak module. The riak state didn't exist yet, hence using module.run to execute a module function. The key point here is the use of the publish.publish to query the ip address of the 'riak00' 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
riak-repo: | |
pkgrepo.managed: | |
- name: deb http://apt.basho.com precise main | |
- disabled: False | |
- key_url: http://apt.basho.com/gpg/basho.apt.key | |
- require_in: | |
- pkg: riak | |
riak: | |
pkg.installed | |
/etc/riak/app.config: | |
file: | |
- managed | |
- source: salt://riak/app.config | |
- template: jinja | |
- require: | |
- pkg: riak | |
/etc/riak/vm.args: | |
file: | |
- managed | |
- source: salt://riak/vm.args | |
- template: jinja | |
- require: | |
- pkg: riak | |
riak.start: | |
module: | |
- run | |
- require: | |
- file: /etc/riak/app.config | |
- file: /etc/riak/vm.args | |
riak.cluster_join: | |
module: | |
- run | |
- riak_user: riak | |
- riak_host: {{ salt['publish.publish']('riak00', 'network.ip_addrs')['riak00']['ret'].pop() }} | |
- require: | |
- module: riak.start |
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
# Add this to your master config | |
peer: | |
'riak*': | |
- network.ip_addrs |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment