mattray / spiceweasel

Generates Chef knife commands from a simple JSON or YAML file.
Apache License 2.0
284 stars 65 forks source link

[feature request] allows to tag each line of the manifest for processing #57

Closed arussel closed 10 years ago

arussel commented 11 years ago

Use case: we're using spiceweasel mainly to deploy cluster in ec2 with manifest looking like: cookbooks:

The problem is:

We tried to get around this by creating multiple manifest file, but we still need have to include in the file the env used in the cluster.

I understand our use case diverge from the main purpose of spiceweasel (batch loading Chef infrastructure), but by just adding tag or similar capabilities, we would be able to manage our clusters with it. Something like: cookbooks [create]: roles [create]: environments[create]: nodes:

and running: spiceweasel -t create => run everything spiceweasel => run only cluster spiceweasel -t dbcreate => run the node create/delete

mattray commented 11 years ago

I was thinking about doing something simple like adding flags for "--cookbooks", "--environments", "--roles", "--data-bags", "--nodes" and "--clusters" to only perform the actions on the flags that were passed. So if you had a complex manifest but only wanted to reload your roles, you'd run

spiceweasel --roles infrastructure.yml

and it would do

knife role from file foo knife role from file bar ....

arussel commented 11 years ago

that would be nice, giving the ability we already have to specify a cluster file, this would probably meet a lot of use case.

mattray commented 10 years ago

Added support in the branch here: https://github.com/mattray/spiceweasel/tree/switches

Still trying to sort out fixing the tests, blocking on this: https://github.com/opscode/mixlib-shellout/issues/61

mattray commented 10 years ago

Merged into the 2.8 branch for the next release. Supported with --only