Config Management

keeping it simple

One thing most configuration management systems have in common is complexity. They take ages to learn and have too many moving parts.

deprec is different!

deprec can generate config files for you to keep in the same version control system you keep your code in. You can even keep them with your codebase in the config/ directory.

:config – pushes generated config file to remote server

The following example generates a simple config file for the NRPE addon for Nagios. We’re prompted for the address of our Nagios server and the generated file is copied to the target hosts.  The :config task is always called by the :install task. It doesn’t leave any residue on the local filesystem.

$ cap deprec:nrpe:config HOSTS=lucid2,lucid3,lucid4
    triggering load callbacks
  * executing `deprec:connect_canonical_tasks'
  * executing `deprec:nrpe:config'
Address(es) of Nagios server(s) (comma sep)
monitor.failmode.com

:config_gen – generates local copy of config file

Before generating a file, :config tasks check to see whether one exists in the staging area. The :config_gen task can be used to generate config files and store them in the staging area under config/. It’s also possible to copy files back from a running server or create them by hand.

$ cap deprec:nrpe:config_gen
    triggering load callbacks
  * executing `deprec:connect_canonical_tasks'
  * executing `deprec:nrpe:config_gen'
Address(es) of Nagios server(s) (comma sep)
monitor.failmode.com

We can now keep our configs under source control and have an automated method for pushing them out.

:config – pushes local copy of config file to remote server (if exists)

Same command as before but we don’t get prompted for the Nagios server address this time. The :config task checks the staging area (under config/) for a local copy of a config file before generating one.

$ cap deprec:nrpe:config HOSTS=lucid2,lucid3,lucid4
    triggering load callbacks
  * executing `deprec:connect_canonical_tasks'
  * executing `deprec:nrpe:config'

is that it?

There’s lots more you can do with deprec config management but you don’t need to know much to get started.

I’m going to focus on some more beginners instructions before coming back to config management.

 

Comments are closed.