Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

Is there any way to automate Linux server configuration? I'm working on setting up a couple of new build servers, as well as an FTP server, and would like to automate as much of the process as possible.

The reason for this is that the setup and configuration of these servers needs to be done in an easily repeatable way. We figured that automating as much of this process as possible would make it easiest to repeat as needed in the future.

Essentially, all the servers need is to install the OS, as well as a handful of packages. There's nothing overly complicated about the setups.

So, is there a way to automate this process (or at least some amount of it)?

EDIT: Also, say I use Kickstart, is there a way to remove the default Ubuntu repositories, and just install the packages from a collection of .deb files we have locally (preferably through apt, rather than dpkg)?

share|improve this question
    
What distro did you choose to install? That would be helpful in determining the next step –  E Carter Young 2 days ago
    
beware however that automation task may take a long time. If you plan to install less than 10 hosts, it might not be worth the task. –  Archemar 2 days ago
    
I've recently learned about the features offered by saltstack (Most contributed repo on Github). I'd highly recommend looking in to it as it offers tools for both creating new servers on services like aws, and deploying configurations, settings, writing files, remote shell access, bulk shell access. even access restriction. Just about everything you'd ever need to do it seems. Though I have good friends who swear by Ansible for new server setups. –  ThorSummoner 2 days ago
    
+1 to you and mattdm... I didn't know this forum existed until I saw it on the Hot Network Questions and then I hadn't even thought this question had an answer. So glad you asked and it was answered so very well! –  Jeremy Miller yesterday

1 Answer 1

up vote 26 down vote accepted

Yes! This is a big deal, and incredibly common. And there are two basic approaches. One way is simply with scripted installs, as for example used in Fedora, RHEL, or CentOS's kickstart. Check this out in the Fedora install guide: Kickstart Installations. For your simple case, this may be sufficient. (Take this as an example; there are similar systems for other distros, but since I work on Fedora that's what I'm familiar with.)

The other approach is to use configuration management. This is a big topic, but look into Puppet, Chef, Ansible, cfengine, Salt, and others. In this case, you might use a very basic generic kickstart to provision a minimal machine, and the config management tool to bring it into its proper role.

As your needs and infrastructure grow, this becomes incredibly important. Using config management for all your changes means that you can recreate not just the initial install, but the evolved state of the system as you introduce the inevitable tweaks and fixes caused by interacting with the real world.

We figured that automating as much of this process as possible would make it easiest to repeat as needed in the future.

You are absolutely on the right track — this is the bedrock principle of professional systems administration. We even have a meme image for it:

AUTOMATE ALL THE THINGS

It's often moderately harder to set up initially, and there can be a big learning curve for some of the more advanced systems, but it pays for itself forever. Even if you have only a handful of systems, think about how much you want to work at recreating them in the event of catastrophe in the middle of the night, or when you're on vacation.

share|improve this answer
1  
Great, thanks! I'll start looking into all of these. –  user1617942 2 days ago
    
You didn't mention Cobbler. –  staticx 2 days ago
    
@staticx Yes, this isn't comprehensive. There's a whole world of provisioning systems too: Cobbler, Foreman, Satellite/Spacewalk, FAI, Razor, and that's not even getting into cloud stuff. –  mattdm 2 days ago
1  
+1 for the meme –  Chris K 2 days ago
    
@ChrisK Ha, I would say the same ;) –  William David Edwards yesterday

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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