Created
August 31, 2011 08:27
-
-
Save arbovm/1183073 to your computer and use it in GitHub Desktop.
opscode chef scripts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
for dir in `find . -type d -depth 1`; do | |
# remove ./ | |
bag=`echo $dir | sed 's/^..//'` | |
knife data bag create $bag; | |
done |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
for file in `find environments/development | grep \.json`; do | |
# dirty regexp to get last dir in path | |
bag=$(echo $file | sed 's/\([^/]*\).\([^/]*\).\([^/]*\).\([^/]*\).\(.*\)/\4/'); | |
knife data bag from file $bag $file; | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment