Skip to content

Add service recipe

Tomasz Maczukin requested to merge add-service-recipe into master

Adds a service recipe to the cookbook. Having this we can prepare a consul service definition using chef.

For example - such attributes in chef role configuration:

// roles/example-consul-server.json

(...)
  "default_attributes": {
    "gitlab_consul": {
      "services": [
        "name": "node_exporter",
        "tags": ["consul_server", "node_exporter"],
        "address": "10.20.30.40",
        "port": 9100,
        "check": {
          "http": "http://localhost:9100/metrics",
          "interval": "30s"
        }
      ]
    }
  }
(...)

will be changed to such file:

// /etc/consul/conf.d/node_exporter.json

{
  "service": {
    "name": "node_exporter",
    "address": "10.20.30.40",
    "port": 9100,
    "tags": ["consul_server", "node_exporter"],
    "check": {
      "http": "http://localhost:9100/metrics",
      "interval": "30s"
    }
  }
}

Merge request reports