This post is one of those quick notes to myself, so I can stop searching this info everytime I need it. This is the sequence of commands to create a self-signed SSL certificate. If you need to know what you are doing please go read this post.
I suggest you to paste them one by one, and by you I mean the future me, that will try to paste them all at once and do something stupid.
So after a time with a team dealing with chef and knife you end having a pretty vast chef repository. Git helps but it can get a little messy, use the little loops below to search for empty roles run lists or roles with no nodes. They work on chef 0.9, chef 0.10 apparently has some fancy search plugin to do the same (and more) but I haven’t tested it yet.
Also, they were originally one liners but I changed it for the sake of readability.
123456
for file in roles/*
do role=$(basename $file)echo -n "Role ${role%.rb}: " knife search node "role:${role%.rb}" -i |grep -v '^$' |wc -l
done
You may not have a directory with roles, so you may need to use that:
123456
for file in $(knife role list|egrep -v '\[|\]'|tr -d ' ,"')do role=$(basename $file)echo -n "Role ${role%.rb}: " knife search node "role:${role%.rb}" -i |grep -v '^$' |wc -l;
done
To search for those pesky empty run_lists (rare, but it happens, automatic cloud instaces, etc…)
123456
for node in $(knife node list |egrep -v '\[|\]' |tr -d ' ",')do echo"Node $node:" knife node show -r $nodeecho"-----------"done
Yes, in this last case you will still have to do some manual work and actually find the empty run lists. Search for empty lines, the only ones present on the file will be the empty run lists.
So, this is a brand new blog, where I will focus on sysadmin and coding stuff. It’s built on the awesome Octopress framework that generates full static content from markdown files and even deploys it using rsync to your site (or github pages, if you are using it). The thing is awesome, I swear.
Stay tunned for more posts on the days coming, I promise that I will try to keep this updated! :)