Node coordination for Consul

I’m new to Ansible, and trying to write a state to set up and bootstrap a Consul cluster.

I seem to have the basics down (downloading packages, and all.) However, I’m stuck on the components of the bootstrap process (http://www.consul.io/docs/guides/bootstrapping.html). Specifically:

  • How can I ensure that a given set of tasks only executes if a command succeeds/fails on all the target servers?
  • How can I run a command on only one server, followed by all the rest?
    Starting servers in consul is pretty easy. But the bootstrap process is a delicate little dance right now, one which I feel Ansible could deal with pretty well. But without these two things, is there any way it could be done?

Basically installing any arbitrary application with Ansible (how to write a playbook) is a bit out of scope for this list.

I’d take a look at github.com/ansible/ansible-examples and more importantly galaxy.ansible.com for some starters on playbook construction, review module docs, and go from there.

If Consul is hard to install, that is somewhat of Consul’s problem, alas :slight_smile: