solarkennedy/puppet-consul — pull request #32 by tehranian (2014-10-15 18:53:02+00:00)
Title: Add support for SLES

**Description**

Created an `init.d` script for managing the Consul service on SLES. Adapted from the example at: https://www.novell.com/coolsolutions/feature/15380.html

**Testing Done**

* Provisioned with Puppet in a Vagrant box of SLES 11 SP3
* Saw that the Consul service was started
* Rebooted the VM; Saw that the Consul service came up automatically
* Verified log content in `/var/log/consul`
* Manually tested the "start", "stop", "restart" functions of the init script and verified correct behavior
* Verified via log file that the SIGHUP from "reload" gets received by the consul daemon

**Relevant output:**

```
vagrant@sles:/var/log> cat /var/log/consul
==> WARNING: It is highly recommended to set GOMAXPROCS higher than 1
==> Starting Consul agent...
==> Starting Consul agent RPC...
==> Consul agent running!
Node name: 'foobar'
Datacenter: 'sjc'
Server: true (bootstrap: false)
Client Addr: 127.0.0.1 (HTTP: 8500, DNS: 8600, RPC: 8400)
Cluster Addr: 10.0.2.15 (LAN: 8301, WAN: 8302)
Gossip encrypt: false, RPC-TLS: false, TLS-Incoming: false

==> Log data will now stream in as it occurs:

2014/10/15 14:35:06 [INFO] serf: EventMemberJoin: foobar 10.0.2.15
2014/10/15 14:35:06 [INFO] serf: EventMemberJoin: foobar.sjc 10.0.2.15
2014/10/15 14:35:06 [INFO] raft: Node at 10.0.2.15:8300 [Follower] entering Follower state
2014/10/15 14:35:06 [WARN] serf: Failed to re-join any previously known node

sles:/var/log # sudo /etc/init.d/consul stop
Shutting down consul done

sles:/var/log # sudo /etc/init.d/consul status
Checking for service consul unused

sles:/var/log # sudo /etc/init.d/consul start
Starting consul done

sles:/var/log # sudo /etc/init.d/consul status
Checking for service consul running

sles:/var/log # sudo /etc/init.d/consul reload
Reload service consul done
```