# Node coordination for Consul

**URL:** <https://forum.ansible.com/t/node-coordination-for-consul/15273>\
**Category:** Ansible Project\
**Created:** [May 20, 2014, 12:22am UTC](https://forum.ansible.com/t/node-coordination-for-consul/15273 "2014-05-20T00:22:29Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Brian\_Hicks](https://avatars.discourse-cdn.com/v4/letter/b/eb8c5e/32.png) [@Brian\_Hicks](https://forum.ansible.com/u/Brian_Hicks)\
**Post date:** [May 20, 2014, 12:22am UTC](https://forum.ansible.com/t/node-coordination-for-consul/15273/1 "2014-05-20T00:22:29Z")

</div>

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](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?

---

<div class="post-metadata">

**Author:** ![Michael\_DeHaan1](https://avatars.discourse-cdn.com/v4/letter/m/5e9695/32.png) [@Michael\_DeHaan1](https://forum.ansible.com/u/Michael_DeHaan1)\
**Post date:** [May 21, 2014, 9:57pm UTC](https://forum.ansible.com/t/node-coordination-for-consul/15273/2 "2014-05-21T21:57:31Z")

</div>

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](http://github.com/ansible/ansible-examples) and more importantly [galaxy.ansible.com](http://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 🙂
