grains:roles:- wwwserver
base:'*':- common_packages
/etc/id.txtfile:- managed- source: salt://id- template: jinja- context:ip: {{ salt['network.interfaces']()['eth0']['inet'][0]['address'] }}
{% for server, addrs in salt['mine.get']['roles:wwwserver', 'network.ip_addrs', expr_form='grain').items() %}{% if {{ ip }} == {{ addrs[0] }} %}{{ loop.index }}{% endif %}{% endfor %}
sudo salt '*' state.highstate
Data failed to compile-------------Rendering SLS 'base:common_packages' failed: Unknown yaml render error; line 2
I haven't used zookeeper, but I would hartily recommend consul. We are using it for service discovery, internal leader election, and aggressive load balancing (haproxy/nginx/consul-template) for all our services.
Nicholas
I'm using the approach Steffen adopted for now. Hardwiring the topology based on deployment significantly simplifies the consensus algorithm so i can see why Zookeeper is doing it. I would like to manage the IDs better, but it's on the TBD list for now.Consul avoids the hardwiring by using network hostnames as default ids but the user can also specify their own ID (https://www.consul.io/intro/getting-started/join.html). If a network is failing badly then fixing the root cause is likely to be the top priority. As long as the consensus algorithm isn't corrupting data or magnifying the effects of the failure then using hostnames may be ok. This would obviously make deployment simpler.
--
You received this message because you are subscribed to the Google Groups "Salt-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to salt-users+...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.