johnbellone/chef-consul — pull request #4 by kevinreedy (2014-05-06 03:27:20+00:00)
Title: Add default recipe which installs and starts consul as a service

Changes in a nutshell:
- The `default` recipe now installs consul, specifying binary vs source based on an attribute (default is binary).
- The `default` recipe now includes the `service` recipe, which creates and starts a consul service. The service can be configured as bootstrap (single host and default), server, or client.
- There is now a `servers` attribute which is an array of servers to connect to on startup. This will allow a wrapper cookbook or role to configure a cluster of consul servers easily. Note that we don't want consul to restart when this list changes, so the init script template does not trigger a restart. We could probably make this smarter by writing a list of hosts to another file which doesn't trigger restart and having the init script read from it. I'm not aware of a good way to test this with test-kitchen.

Other notes:
- This PR also reincludes https://github.com/johnbellone/chef-consul/pull/3, which seems to have gotten rebased out by accident. Let me know if I should remove it.
- Both before and after this PR, tests aren't being run against the `binary` or `source` suites, as the tests are defined only for the `default` suite.

`kitchen verify` before PR:
```
Instance Driver Provisioner Last Action
binary-ubuntu-1204 Vagrant ChefZero Verified
binary-ubuntu-1404 Vagrant ChefZero Verified
binary-centos-65 Vagrant ChefZero Verified
binary-centos-510 Vagrant ChefZero Verified
source-ubuntu-1204 Vagrant ChefZero Created
source-ubuntu-1404 Vagrant ChefZero Created
source-centos-65 Vagrant ChefZero Verified
source-centos-510 Vagrant ChefZero Verified
```

`kitchen verify` after PR:
```
Instance Driver Provisioner Last Action
default-ubuntu-1204 Vagrant ChefZero Verified
default-ubuntu-1404 Vagrant ChefZero Verified
default-centos-65 Vagrant ChefZero Verified
default-centos-510 Vagrant ChefZero Verified
binary-ubuntu-1204 Vagrant ChefZero Verified
binary-ubuntu-1404 Vagrant ChefZero Verified
binary-centos-65 Vagrant ChefZero Verified
binary-centos-510 Vagrant ChefZero Verified
source-ubuntu-1204 Vagrant ChefZero Created
source-ubuntu-1404 Vagrant ChefZero Created
source-centos-65 Vagrant ChefZero Verified
source-centos-510 Vagrant ChefZero Verified
```