# irrigate-haproxy-cookbook

This cookbook configures haproxy, keepalived, and optionally ssl.

As of April 2023, this cookbook expects to serve haproxy config files from cookbook files rather than using a templating engine. This means that there must be a cookbook file in `files/haproxy_${some_cluster_name}.cfg', in which the cluster name variable matches the value of the `node['haproxy']['cluster_name']`. 

It supplies some sensible default attributes, but the following additional attributes must be supplied
in order for the cookbook to be functional:

```json
{
  "ssl_cert": {
    "cert_file_location": "",
    "cert_data_bag": ""
  },
  "haproxy": {
    "cluster_name": "some_cluster_name"
    }
  },
  "firewall": {
    "firewalld": {
      "permanent": true
    }
  }
}
```

## Supported Platforms

CentOS 6, 7
RedHat 6, 7

## Usage

At minimum, include the following recipes:

```json
{
  "run_list": [
    "recipe[haproxy::package],"
    "recipe[haproxy::config],"
    "recipe[haproxy::service],"
  ]
}
```

Add the certs recipe if your configuration requires SSL. 
