<commit_before># confd

`confd` is a lightweight configuration management tool focused on keeping local
configuration files up-to-date by polling [etcd](https://github.com/coreos/etcd)
for specific keys and regenerating templates when values change. `confd` can also
take care of reloading applications to pick up new config file changes.

## Install

```
go get github.com/kelseyhightower/confd
```

## Configuration

The confd configuration file is written in the TOML format and is loaded from
`/etc/confd/confd.toml` by default.

Optional:

 * `confdir` (string) - The path to confd configs. The default is "/etc/confd".
 * `etcd_nodes` (array of strings) - An array of etcd cluster nodes. The default
   is ["http://127.0.0.1:4001"].
 * `interval` (int) - The number of seconds wait between calls to etcd. The
   default is 600.
 * `prefix` (string) - The prefix string to prefix to keys when making calls to
   etcd. The default is "/".

Example:

```TOML
[confd]
  confdir = "/etc/confd"
  etcd_nodes = [
    "http://127.0.0.1:4001",
  ]
  interval = 600
  prefix = "/"
```

## confd Configs

`confd` configs are written in TOML and define a single template resource.
`confd` configs are stored under the `confdir/conf.d` directory.

Example:

```TOML
[template]
  src = "nginx.conf.tmpl"
  dest = "/etc/nginx/nginx.conf"
  group = "root"
  keys = [
    "/nginx/worker_processes",
  ]
  owner = "root"
  mode = "0644"
  check_cmd = "/usr/sbin/nginx -t -c {{ .src }}"
  reload_cmd = "/usr/sbin/service nginx restart"
```

## Template Resource<commit_msg>Template resources are documented under confd configs<commit_after># confd

`confd` is a lightweight configuration management tool focused on keeping local
configuration files up-to-date by polling [etcd](https://github.com/coreos/etcd)
for specific keys and regenerating templates when values change. `confd` can also
take care of reloading applications to pick up new config file changes.

## Install

```
go get github.com/kelseyhightower/confd
```

## Configuration

The confd configuration file is written in the TOML format and is loaded from
`/etc/confd/confd.toml` by default.

Optional:

 * `confdir` (string) - The path to confd configs. The default is "/etc/confd".
 * `etcd_nodes` (array of strings) - An array of etcd cluster nodes. The default
   is ["http://127.0.0.1:4001"].
 * `interval` (int) - The number of seconds wait between calls to etcd. The
   default is 600.
 * `prefix` (string) - The prefix string to prefix to keys when making calls to
   etcd. The default is "/".

Example:

```TOML
[confd]
  confdir = "/etc/confd"
  etcd_nodes = [
    "http://127.0.0.1:4001",
  ]
  interval = 600
  prefix = "/"
```

## confd Configs

`confd` configs are written in TOML and define a single template resource.
`confd` configs are stored under the `confdir/conf.d` directory.

Example:

```TOML
[template]
  src = "nginx.conf.tmpl"
  dest = "/etc/nginx/nginx.conf"
  group = "root"
  keys = [
    "/nginx/worker_processes",
  ]
  owner = "root"
  mode = "0644"
  check_cmd = "/usr/sbin/nginx -t -c {{ .src }}"
  reload_cmd = "/usr/sbin/service nginx restart"
```

### Template Resource
{'fraction_non_alphanumeric': 0.1243277443846884, 'fraction_numerical': 0.018981335020563112, 'mean_word_length': 3.5365853658536586, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 4, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6657857', 'n_tokens_mistral': 1107, 'n_tokens_neox': 1056, 'n_words': 367}