Skip to content

Instantly share code, notes, and snippets.

@benjaminws
Created December 1, 2011 18:01
Show Gist options
  • Save benjaminws/1418613 to your computer and use it in GitHub Desktop.
Save benjaminws/1418613 to your computer and use it in GitHub Desktop.
Save roles
#!/bin/bash
# Get all your roles, save them to disk.
set -e
KNIFE=/usr/bin/knife
SAVE_DIR=~/chef-repo/roles
for role in `$KNIFE role list`; do
$KNIFE role show -F json $role > $SAVE_DIR/$role.json;
done;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment