Skip to content

Instantly share code, notes, and snippets.

@spheromak
Created April 26, 2011 19:19
Show Gist options
  • Save spheromak/942898 to your computer and use it in GitHub Desktop.
Save spheromak/942898 to your computer and use it in GitHub Desktop.
node dumper
Bin="$( readlink -f -- "${0%/*}" )"
# assum bin is in chef_repo so nodes goto ../nodes/*
if [ -d $Bin/../nodes/$node ] ; then
for node in `knife node list -F text | awk -F\" '{print $2}'` ; do
echo "dumping $node"
knife node show $node > $Bin/../nodes/$node.json
done
else
echo "were tring to dump nodes to $bin/../nodes/, but it doesn't seem to exist."
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment