Skip to content

Instantly share code, notes, and snippets.

@dragolabs
Last active August 29, 2015 14:19
Show Gist options
  • Select an option

  • Save dragolabs/2a0fd2b967f5be03f992 to your computer and use it in GitHub Desktop.

Select an option

Save dragolabs/2a0fd2b967f5be03f992 to your computer and use it in GitHub Desktop.
Script for create description for chef's nodes in attribute "desc".
#!/bin/bash
echo "Set description for chef's nodes. Press ENTER to skip node."
for NODE in `knife search "! desc:*" -i | tail -n+2`;do
echo "Node: ${NODE}"
echo -n 'Description: '
read DESC
if [ ! -z "${DESC}" ];then
knife node attribute set ${NODE} desc "${DESC}"
else
continue
fi
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment