Puppet or chef for stand alone server with limited resources

chefconfiguration-managementpuppet

I have a small virtual linux server (500 megs ram). I may eventually get one or two more servers, not more.

I'm a dev, not a sys admin so I don't know the best practices involving linux administration. I do know that I don't want to setup a machine, issue a bunch of commands to set up users, install packages, change environment variables, only to lose all of it if my machine crashes.

I'd rather keep all this information in a source repository, along with my code.

Obvious solutions are puppet or chef, but I don't run a cluster of machines. I want a declarative way of setting up users, installing packages, etc. but don't want to setup ssl certificates, master servers, etc. (frankly, I can't, my machines are very cheap and have very little memory).

Is there a better solution for stand-along machines? I want to be able to use this solution quickly to re-create my machine (on amazon, linode, rackspace or my down desktop).

Best Answer

Puppet is pretty easy to setup. You don't have to do almost anything, and a client can run standalone. Let me just give you an example. Say you have a file called config.pp with the following lines:

package { 'apache2': ensure => installed }
service { 'apache2':
   ensure  => running,
   enable  => true,
   require => Package['apache2'],
}
user { 'bob':
   ensure  => present,
   uid     => 1000,
   gid     => 'bob',
   require => Group['bob'],
}
group { 'bob':
    ensure => present,
    gid    => 1000,
}

If you run puppet apply config.pp, it will ensure the package apache2 is installed, that the service is running and enabled to start when booting, and that the user bob will be created with the group bob.

That's all -- install puppet client, type that into this file, and run a command. You may schedule that on crontab if you feel like guaranteeing the configuration is kept in check, without a master. I once installed 10 ganeti servers -- which involves setting up a number of packages and configurations, with at least one reboot midway -- pretty much like this.

Puppet does consume some memory -- 500 MB is a bit on the low end, but if you are going to run it mostly to install stuff, it should be enough. I keep my own servers at 1 GB, at least, to guarantee puppet won't cause problems to the services running on the server.

Also, Puppet is definitely declarative, though you may need to augment it a bit either with scripts to be run, or with ruby code to teach it new tricks. For your needs, it seems unlikely you'll have to resort to that.

Related Topic