Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I have installed and configured a ubuntu server (installing additional packages and making modifications to some configuration files). Now I would like to install an almost identical system, which has just a different IP, hostname, or anything like these. Is there any script or tool that can automate this process?

I am not looking for something like Clonezilla, which makes an image clone. I am not looking for something like remastersys, which creates an ISO image. I would like something like this: http://www.debianadmin.com/clone-your-ubuntu-installation.html or this: http://ubuntuforums.org/showthread.php?t=525660 , but more complete and automatic.

Basically, this tool should scan the existing system and extract a list of packages that are installed. Then compare the configuration files on the system with the default configuration files of each package and generate diffs where they are different. However it should also identify the configurations that are different for each server (like IP, hostname, etc.) and give an option to customize them.

All this should be done automatically, and the output should be a very small sized "DNA" of the current system. Then a tool like debootstrap should be used to install the new system, and the changes that are described on the "DNA" should be applied to it: installing new packages and modifying their configuration files.


About the motivation:

I manage a virtual web server in cloud where I have made lots of configurations over time: related to security, different packages etc. Now, if I want to build another server that has the same function and purpose as the first one, the long and tedious way would be to go over all the installations and configurations again, and still I may miss something. I thought that maybe there is any tool out there that can make something like a diff between the current state of the server and the initial state of a just installed server. This diff would also help me to audit the current system, I don't exactly remember all the things that I have touched and messed in it.

Such a diff could also serve as a recipe that I can share with my friends, if they want to build a system like mine. It would be much more convenient and safe than passing around huge tarballs or images.


The tools suggested for cloning:

Some of the tools suggested are:

But none of them is suitable for my case.

share|improve this question
    
Can you explain why you want to clone your server? If it is for web development, for instance, you should definitely have a one-click deploy script (for python look into fabric). –  don.joey Feb 22 '13 at 10:08
1  
I manage a virtual web server where I have made lots of configurations over time. Now, if I want to build another server that has the same function and purpose as the first one, the long and tedious way would be to go over all the installations and configurations again, and still I may miss something. I thought that maybe there is any tool out there that can make something like a diff between the current state of the server and the initial state of a just installed server. This diff would also help me to audit the current system. –  dashohoxha Feb 22 '13 at 13:44
    
Such a diff could also serve as a recipe that I can share with my friends, if they want to build a system like mine. It would be much more convenient and safe than passing around huge tarballs or images. –  dashohoxha Feb 22 '13 at 13:45
    
+1 nice edit. Can you explain why these tools are not suitable? –  don.joey Feb 22 '13 at 15:10
    
+1 nice comment. Can YOU explain why do you think they are suitable? –  dashohoxha Feb 22 '13 at 20:04

2 Answers 2

If two systems have the same packages installed, and you make a diff of their /etc directories, you will basically get all the configuration changes between them (maybe not 100% of them but still very accurate). So, what I did to audit my system was this:

Of course, this diff cannot be readily used to install and configure another system, but knowing where are the differences and what they are, can help to build a tklpatch (like this: https://github.com/dashohoxha/B-Translator/tree/master/tklpatch), which of course is not quite easy to be done and requires some work.

Then, I can distribute/publish this tklpatch and everybody can build easily a system quite similar to mine.

share|improve this answer
    
See also: dashohoxha.blogspot.com/2013/02/… –  dashohoxha Feb 22 '13 at 21:30

I think you could use dpkg --get-selections. Then install those packages on your new server. The configuration files you can copy from the old server. It is not painless, but it is accessible.

Source

share|improve this answer
    
Some of the tools suggested are: Mondorescue, Clonezilla, Remastersys, TKLBAM, Snap, Cobbler, Puppet, Cfengine, Chef, etc. But none of them is suitable for my case. –  dashohoxha Feb 22 '13 at 14:57

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.