Skip to content

Instantly share code, notes, and snippets.

@scalp42
Forked from benjaminws/save_roles.sh
Created April 26, 2012 03:30
Show Gist options
  • Save scalp42/2495517 to your computer and use it in GitHub Desktop.
Save scalp42/2495517 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