travis-ci/travis-images — pull request #8 by maxlinc (2014-07-23 21:46:42+00:00)
Title: Role YAML conversion utility

This is to answer @joshk's question on https://github.com/travis-ci/travis-cookbooks/pull/300

> we should probably move this discussion to another thread, but in interests sake, what might this look like? I guess we wouldn't use yaml anymore?

I created a utility that will convert the current YAML definitions to standard [Chef Role definitions](http://docs.opscode.com/essentials_roles.html). You can generate either Ruby DSL or JSON, so check them out and see if you have a preference. You can see from the relatively straightforward generator that there isn't a big difference between the current YAML and the Chef equivalents, but using the standard format makes it easier to use the roles with other tools like Vagrant, Test-Kitchen or Packer.

Usage:

```bash
$ bundle exec thor travis:roles:convert templates/*.yml
# Generates roles/*.rb
$ bundle exec thor travis:roles:convert --format=json templates/*.yml
# Generates roles/*.json
```

/cc @gildegoma @BanzaiMan