candlepin/candlepin — pull request #385 by awood (2013-09-23 20:00:50+00:00)
Title: Generate candlepin.conf based on a template and YAML data.

This patch adds a "candlepin:erb" task to buildr. When this task is run, a `candlepin.conf` file is auto-generated based on the template in the new `erb` directory. The template uses a set of standard defaults coupled with values defined in the new `profiles.yaml` file and with values defined in `custom.yaml`. The `custom.yaml` file is not (and should not be) required by default (and it is in the .gitignore file). An example `custom.yaml` is below:

```
candlepin.conf:
custom_logging:
"#org.hibernate.SQL": "DEBUG"
"org.candlepin.servlet.filter": "DEBUG"
additional_properties: |
log4j.logger.something.else=DEBUG
```

There are a few things to note. The first is that the first key in the YAML file must correspond to the file name of the rendered template. Secondly, the custom_logging property takes a dictionary of class names and log levels. Appending a "#" to the class name will place the line in the rendered file but commented out. Finally, any additional values can be specified by dropping them after the pipe symbol that follows the additional_properties key.

Please note that whitespace is important in YAML. See http://www.yaml.org/YAML_for_ruby.html and http://www.yaml.org/refcard.html

The rendered template is placed in `target/generated/erb/candlepin.conf`

I plan on incorporating this with `buildconf/scripts/deploy` after the MySQL branch is merged in.