Tag Archives: opscode

knife bash completion – with fixed environments autocomplete

Steven Danna has written the best knife bash completion script that I’ve seen for use with managing chef servers and the chef software by opscode. Update: Steven has now made an update so this is working! There was always one little thing wrong with it though: knife environment edit (etc) would not autocomplete – it would give an error The error was: -bash: _chef_environments: command not found The solution is pretty simple – you just need to edit the script and transpose two letters that were a typo from the knife_completion.sh file: _chef_environemnts should actually be: _chef_environments The difference is hard to spot but it’s key. Two other scripts for knife completion (that I don’t like as much) are this one by avishai-ish-shalom and a spinoff by vindimy – I think they are slower and not as user friendly. If you use zsh instead of bash there is also a zsh knife plugin which is part of oh-my-zsh that seems pretty good.

Posted in Server Administration, Tech Tips | Tagged , , | Leave a comment

ec2 server create syntax (man page)

This is the knife create syntax page. I was trying to launch an instance of Chef with the “knife create” command that chef’s knife provides. The documentation page gives this example for how to launch a web server on Amazon’s EC2 server, but without much explanation of the terms: knife ec2 server create -r “role[webserver]” -I ami-2d4aa444 –flavor m1.small -G www,default -x ubuntu -N server01 After doing some searching I just ended up digging into the code and found this information quite helpful, and so I am sharing it: -f FLAVOR ( or –flavor FLAVOR ) The flavor of server (m1.small, m1.medium, etc) default: m1.small -I IMAGE ( or –image IMAGE ) The AMI for the server -G X,Y,Z ( or –groups X,Y,Z ) The security groups for this server default: “default” -Z ZONE ( or –availability-zone ZONE ) The Availability Zone default: us-east-1b -N NAME ( or –node-name NAME ) The Chef node name for your new node -S KEY ( or –ssh-key KEY ) The AWS SSH key id -x USERNAME ( or –ssh-user USERNAME ) The ssh username default: root -P PASSWORD ( or –ssh-password PASSWORD ) The ssh password -i IDENTITY_FILE ( or –identity-file IDENTITY_FILE ) The SSH identity file used for authentication –prerelease Install the pre-release chef gems –bootstrap-version VERSION The version of Chef to install -d DISTRO ( or –distro DISTRO ) Bootstrap a distro using a template default: ubuntu10.04-gems –template-file TEMPLATE Full path to location of template to use –ebs-size SIZE The size of … Continue reading

Posted in Linux, Server Admin, Server Administration, Tech Tips, Web Development | Tagged , , , , , , | Leave a comment