Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm working on setting up a Linode VPS from scratch but instead of doing it manually I wish to use Chef so I can easily automate it in the future.

The question I have is:

I realise you can set up packages and whatever but how do you accomplish all the other smaller steps:

For example, set the host name, security setup, firewall.

I am sort of following this guide but want to change some parts to suit my application:

share|improve this question

closed as not a real question by Chris S Nov 17 '12 at 4:59

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.If this question can be reworded to fit the rules in the help center, please edit the question.

This seems to be asking at least 3 or more questions... all of them complex enough to be their own subject matter. – vgoff Nov 17 '12 at 4:04
Sorry, this question is way too broad for a simple Q&A site. If you can break it down into bit size questions they may stand on their own, but we certainly aren't here to do your job for you. Chef has guides and documentation, you need to show that you've made a minimum effort to review it first. – Chris S Nov 17 '12 at 5:00
up vote 2 down vote accepted

Take a look at Opscode's official cookbooks repository and see if there's something fitting your needs (or that you can easily modify).

If not, you can do script blocks to execute code in your recipes. Documentation for that can be found here.

share|improve this answer
ok, Just for an example, could you show me how I would write this as part of my solo.rb file? echo "plato" > /etc/hostname hostname -F /etc/hostname If it exists, edit the file /etc/default/dhcpcd to comment out the SET_HOSTNAME directive: File excerpt:/etc/default/dhcpcd #SET_HOSTNAME='yes' – rctneil Nov 10 '12 at 17:52
Hmm. I wouldn't put it in the solo.rb file. I would set up a specific cookbook that will be included in solo.rb, which will be specific to your institution that will do that, and set up a node.json with the specific settings for that instance (e.g., hostname). I also wouldn't edit a file; I would set up a template in the cookbook and would overwrite a given file with what you want. – cjc Nov 10 '12 at 22:11
Sorry, I meant put it in a recipe. I have a cookbook called main and have started to put it in a recipe within main. You said to create a template and overwrite a file but if I make a template with the hostname stuff in it then surely it'll overwrite what is already in that file? How do I deal with that? Basically my aim is to create a chef setup which will pretty much follow this: plus the steps on on securing the server. Thats all I want it to do for now and yes maybe chef is overkill for one server but there we go! :-) – rctneil Nov 11 '12 at 11:19
I ended up moving to Ansible for my server automation. Works really nicely. – rctneil Feb 28 '14 at 21:40

Not the answer you're looking for? Browse other questions tagged or ask your own question.